SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS Matrix Percentage calculation


SSRS Matrix Percentage calculation

Author
Message
Dan Colbert-387424
Dan Colbert-387424
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1359 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.
Marianne L Collins
Marianne L Collins
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1060 Visits: 751
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
Dan Colbert-387424
Dan Colbert-387424
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1359 Visits: 338
Thanks Marrianne!

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

Dan
BWCA
BWCA
SSC-Enthusiastic
SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)SSC-Enthusiastic (151 reputation)

Group: General Forum Members
Points: 151 Visits: 73
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).
kcooper
kcooper
SSC Veteran
SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)SSC Veteran (280 reputation)

Group: General Forum Members
Points: 280 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!
Attachments
example.JPG (530 views, 41.00 KB)
Donna Collins
Donna Collins
SSC-Enthusiastic
SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)SSC-Enthusiastic (111 reputation)

Group: General Forum Members
Points: 111 Visits: 211
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.
sneilson
sneilson
SSC Veteran
SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)SSC Veteran (239 reputation)

Group: General Forum Members
Points: 239 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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search