Last post Jul 10, 2013 02:47 PM by novell yang
May 06, 2008 03:54 AM|khaliqsyed|LINK
Hello every one, I am trying to get the total percentage of a column
Thanks in advance for any tips/solutions.
May 06, 2008 04:15 AM|ShivaKarthik|LINK
Here is the solution
You select each of that value in particular region A,B,C,D and store that in some variables using some condition
Then define another variable for total then you total all these values
define another variable for percentage and divide the above variable by 5
Then return the last variable.
Mark As Answer if this helps you
Further Queries Recommended
May 06, 2008 06:51 AM|BlogPortalist|LINK
Please elaborate what you mean by "get the total percentage of a column". If it's hard to put words on it - please post a similar table as the one you posted, but with your desired result, and I or someone else can most probably come up with a SQL query
to help you out.
May 06, 2008 12:08 PM|khaliqsyed|LINK
Thank you for your response, I am basically trying to write a stored procedure which calculate the percentage of each column using temp tables to create "Percent Complete" table.
I appeciate your time and if you could advice how to get the "Workbooks Sent" Percentage for Region A and Total of Region (A,B,C&D), I think I can utilize the same for rest of the "Percentage Complete" Table/Report.
Once again thank you for your time.
May 06, 2008 04:22 PM|XPSCodes|LINK
Queries would look something like this:
select cast(WorkbooksSent as decimal(11,2))/WorkbooksRequired * 100 as PWorkbooksSent
select cast(Sum(WorkbooksSent) as decimal(11,2))/Sum(WorkbooksRequired) * 100 as PWorkbooksSentTotal
Jul 10, 2013 02:47 PM|novell yang|LINK
I happened to find your SQL code to resolve the Percentage problem and I have a similar question with a different property. Could you please help me with it?
Here is my question: I am trying to get the percentage (%) of the total SQFT column for each record and name the added-in calculation column as "Allocation". For example, A is occupied 24% of the Total SQFT (=round(20/82,2). I need to build up the calculation
column "Allocation". Please have a look at the table below.
Thank you very much for your time and help in advance!