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

Matrix Total Expand / Collapse
Author
Message
Posted Friday, May 3, 2013 1:52 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, May 10, 2013 3:43 PM
Points: 42, Visits: 130
Hello,

I'd appreciate if you guys help me with my problem in a matrix. In the following SSRS 2008 matrix, notice I have a Row named FieldName, and only one field in the Data area named Value. My question is: Let's say we have Field 1, Field 2, and Field 3, and in the "Total" area of Field 3, I want to display the result of a division of Field1/Field2. How can this be done?

Post #1449351
Posted Tuesday, May 7, 2013 12:38 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, March 17, 2014 11:46 PM
Points: 17, Visits: 30
can you explain it more..
Post #1449999
Posted Sunday, May 12, 2013 6:13 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: 2 days ago @ 5:47 AM
Points: 476, Visits: 879
Assuming your field1 and field2 are rows, you can create a row group. Generally groups rely on the dataset having the same value in a certain column.
e.g. If you have a "Country" column and some of the rows say "Canada" you can group rows by Country and all the "Canada" rows will be in the same group.
If you don't have any useful grouping column and you want to group all columns for the purpose of doing these totals, or divisions, you can use =1 as the grouping formula.

The easiest way to then do a total for the "sum[value] of field 1 / sum[value] of field 2" is to refer to the fields by their name (name of the cell/text box). Assuming you've named those cells "Field1total" and "Field2total"

So the formula looks somewhat like
=ReportItems!Field1total.Value/ReportItems!Field2total.Value

From there you need to be careful about not dividing by zero - for example if the Field2total cell is zero you will have further problems.

What I've said here may or may not work depending on your exact layout but the "ReportItems!" reference is super useful I've found.
Post #1451955
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse