I found the function, RunningValue(Expression, Function, Scope) handy and it solved my problem. For the subtotal of the First N records, the RunningValue function was called as follows,
= RunningValue(IIF( Fields!RowNum.Value <= N, Fields!SomeCol.Value , Nothing), SUM, "Group1")
Notes:
- One needs to have the row number ready before passing it to SQL Server Reporting Services, because RunningValue can't access the row numbers computed using RowNumber function.
- One has to use the 'Nothing' parameter in the IIF function. It can not be zero, or Reporting Services would throw an error at run time. That took me a while to find the solution here.
- The SQL Server Reporting Services forum is really helpful.
1 comment:
Thank you for this "Nothing", made my way to a solution faster!
Post a Comment