Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SSRS Matrix Percentage calculation Expand / Collapse
Author
Message
Posted Thursday, August 21, 2008 5:56 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, May 13, 2013 2:51 PM
Points: 269, Visits: 338
I have a simple matrix as such:

Rows: Return reasons
Columns: Week Start Date
Data cells:
Two text boxes in each column:
1) Sum of RMAs (works as desired)

2) In the second data text box, I want to have the percent of RMAs for that cell based on the column total. The only total I can get in my expression is the total for the whole grid - not the specific column.

I'm sure it's something simple (at least I hope!), so any help would be appreciated.

Thanks in advance.
Post #556429
Posted Tuesday, September 30, 2008 1:01 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, August 26, 2014 12:58 PM
Points: 224, Visits: 748
Assuming the name of the column group is WeekStartDate, something like the following should work:

=iif(iif(isnothing(Sum(Fields!RMAs.Value,"WeekStartDate")),0,Sum(Fields!RMAs.Value)/Sum(Fields!RMAs.Value,"WeekStartDate"))=0,nothing,Sum(Fields!RMAs.Value)/Sum(Fields!RMAs.Value,"WeekStartDate"))

Note: the expression above is also eliminating divide by zero errors

Hope this helps!
-Marianne
Post #578603
Posted Tuesday, September 30, 2008 1:04 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, May 13, 2013 2:51 PM
Points: 269, Visits: 338
Thanks Marrianne!

I'll give it a shot and let you know how it works!

Dan
Post #578604
Posted Wednesday, November 12, 2008 11:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 13, 2012 7:27 AM
Points: 8, Visits: 46
Thanks! This works great! Make sure to go into your matrix properties to look up the column name...(in other words, it's the overall matrix column name, not the individual column name).
Post #601609
Posted Thursday, June 11, 2009 3:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, March 17, 2010 11:23 AM
Points: 118, Visits: 122
I think I have a similar question, in trying to get a column group's percentages. I want to calculate a matrix running total within columns groups, then use these values to get a percentage. I'm sure inscope is part of the solution but I can't seem to get the results I need.

Please review the attached example, as showing is easier to explain!


  Post Attachments 
example.JPG (370 views, 41.70 KB)
Post #733379
Posted Thursday, March 1, 2012 3:29 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, September 2, 2014 5:43 PM
Points: 4, Visits: 167
It's been sometime since your post, but this was the best solution I found today for this issue. Only thing is if you have a group subtotal the subtotal will also include the % that will always be 100%. I have to work out an expression to hide the % column on the subtotal.
Post #1260494
Posted Wednesday, August 29, 2012 10:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 21, 2014 7:32 AM
Points: 7, Visits: 76
I have a similar issue I think - and really struggle with the principle of scope being a part time developer! I have a matrix that shows the last 6 months as columns, call types as rows, and the number of calls by type. I have managed to calculate the percentage overall of calls by type, but want to do a comparison to show what the percentage is just for the current month as well as the 6month total. How do I select a specific column value to work with please?
Post #1351768
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse