Reputation: 725
I have a SSRS report which consists of the matrix table. This matrix has a row Groups called ItemId1. I want to add line number to this matrix. when I add a expression RowNumber(nothing) the results is as follow :
when I add expression RowNumber("ItemId1"), the report is shown as follow:
I want just line number based on the row, I mean I expect line number 2 instead of 7 (or 8)
Upvotes: 1
Views: 10086
Reputation: 5531
on Right hand side I have grouped by Category and Here is how I solved it
=RunningValue(Fields!category.Value,CountDistinct, "DataSet1")
In your case it shall be
=RunningValue(Fields!ItemId.Value,CountDistinct, "DataSet1")
Upvotes: 0
Reputation: 21683
You cannot use RowNumber as this looks at the dataset rather than what is displayed. What you actually need to do is get the number of unique ItemID
's on or before each group.
This is actually much simpler than it sounds !
You can use RunningValue
to do exactly this.
=RunningValue(Fields!ItemId.Value,CountDistinct, "DataSet1")
You will just need to change the dataset name to whatever your dataset is actually called.
Here's the output from a sample report I created. The first column shows a similar result to yours when RowNumnber is used. The second column uses the RunningValue method.
Upvotes: 5