ezkhan
asked on
Calculate total and percentage columns from ssrs 2008 r2 dataset for reports.
Hi,
I have a situation to calculate the total of a column in dataset in ssrs 2008 r2 to calculate percentage in another column.
e.g.,
ValueColumn TotalColumn PercentageColumn
20 69 20/69*100
33 69 33/69*100
46 69 46/69*100
I want to create TotalColumn and Percentage from SSRS 2008 R2 dataset (using calculated field or some other method not sure!!!!!!!!!!!)
Your help and suggesionss are highly appreciated.
Thanks.
I have a situation to calculate the total of a column in dataset in ssrs 2008 r2 to calculate percentage in another column.
e.g.,
ValueColumn TotalColumn PercentageColumn
20 69 20/69*100
33 69 33/69*100
46 69 46/69*100
I want to create TotalColumn and Percentage from SSRS 2008 R2 dataset (using calculated field or some other method not sure!!!!!!!!!!!)
Your help and suggesionss are highly appreciated.
Thanks.
ASKER
I can do it in db but these columns are not individual columns e.g.,
As per your select statment ValueColumn is derived from number of aggregagetes and divisions with 10 different columns in database dataset. If I calculate percentage again in database then i need to calculate ValueColumn twice and there more than one columns where i need to calculate percentage. It slows down the whole query and increases CPU usage.
Thats why I want to calculate percentage from already calculated columns in Reporting Services instead of DB.
Please suggest solution in reporting services. Your answers and suggestions are greatly appreciated.
Thanks
TotalColumn:
=Sum(Fields!ValueColumn.Value, "DataSetName")
PercentageColumn:=Fields!ValueColumn.Value/Sum(Fields!ValueColumn.Value, "DataSetName")*100
try this
=Sum(Fields!FieldName.Value,"DatasetName")
=Round((Fields!SrNo.Value/SUM(Fields!FieldName.Value,"Dataset")*100),2)
Please use custom code or assembly reference.
https://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_7316-Variable-Custom-Code-and-Assembly-reference-in-SSRS.html
https://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/A_7316-Variable-Custom-Code-and-Assembly-reference-in-SSRS.html
ASKER
Thanks a lot for your suggesions; I want to use this calculated percentage column in pie chart as series!!!!!!!!!
Is this possible???????????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might be able to do this:
SELECT ValueColumn, TotalColumn, ValueColumn/TotalColumn*10