May 15, 2012 at 1:27 pm
Hello,
I designing a report:
I have the columns numberOfCases...
My report is displaying
NumberOfCases Percentage (Calulated as expression)
--------------- ------------
Total Sum(NumberOfCases) ????
How can I calculate the total percentage....I do not want to divide
SUM(NumberOfCases)/SUM(NumberOfCases) *100
I want to sum that column.
Thank you
May 15, 2012 at 1:32 pm
Can you try to more clearly explain what you are looking for?
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 16, 2012 at 5:52 am
What I need is very simple :
My dataset contains two column and ID column and a NumberOfCases columns.
I'm calculating the percentage of each ID in the table by dividing each NumberOfcases by total numberOfCases. How ever I want to give a sum of these percentages in the Last row. How can I sum an expression in the table ?
Thank you
Example:
ID NumberOfCases Percentage
1 17 10.0 %
2 28 16.5 %
3 30 17.6 %
4 45 26.5 %
6 50 29.4 %
Total 170 100 % ==========> I need this % total.
The total of NumberOfCases is easy to get by having a sum on a field...But the percentage is not a field...It is calculated in an expresion in the table.
May 16, 2012 at 7:47 am
Why can't you just calculate it? In this case there really isn't much need to calculate it. The formula you showed has only two possible values (0 or 100).
SUM(NumberOfCases)/SUM(NumberOfCases) *100
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
May 16, 2012 at 7:54 am
i want to do a sum on the derived column...any ideas ?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply