How to get RowNumber working with row group?
We have a matrix report which groups by different facilities in the selected region and displays them against different measures. We want to add a row number on the very left side of the report. Using rownumber("Row Group Name") or rownumber("DataRegionName")
shows an error while RowNumber("DatasetName") or RunningValue(Fields!Facility.Value,CountDistinct,"DatasetName") only shows total value. How should we set this expression so that we can have a distinct row number for every facility in the report? (Only one
row group in the Matrix)
Thanks!
P
July 22nd, 2011 1:26pm
Try using this formula
=RunningValue(Fields!Facility.Value, CountDistinct, "Row Group Name")
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 2:05pm
Thank you for the reply but it throws an error : Scope parameter is not a valid string eventhough I pass a string ("Matrix1_Facility_Name") as 3rd parameter of RunningValue.
July 22nd, 2011 2:14pm
Two things I would check, is the expression done in a textbox that is within the scope of Matrix1_Facility_Name, and also the group name has to be spelled exactly as it is in the group's name property, and is case sensitive? Not sure why else it
wouldn't work without more info.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 2:27pm
Hi SSASBeginner,
Based on your description, there is a matrix with a row group
<Facility> in your report. Now, you need to count total rows within a group. If I have misunderstood, please point out.
To have a test:
Drag Matix to design surface.
Drag a field
Year from dataset to the cell containing Columns as column group.
In the cell containing Row, select
Region from the field list icon as row group.
Right-click the handle of first column, hover the mouse on Insert Column, and click
Inside Group-Left. Please be aware that, if we choose outside group, the Scope parameter of the aggregate function will only be able to identify dataset name or tablix name.
Right-click the textbox left [Region], click Expression.
In the Expression dialog box, set the expression as: “= RowNumber(“Region”)”.
If you are still unable to work with group scope, please provide me more information. Such as the main dataset,
the matrix structure, and some sample data.
Thanks,
Lola
Please remember to mark the replies as answers if they help.
July 25th, 2011 5:18am