Sum of distinct in SSRS

☆樱花仙子☆ 提交于 2020-01-16 08:38:13

问题


I have to get distinct rows sum in SSRS expression.

**StudentId  TestScoreMath   CurriculumEnrolled      EnrollStatus**

  100              200            Nursing             Enrolled

  100              200            Physical              Enrolled

  200              100             Tech                Enrolled

Total Student TestScoreMath should be 300 not 400. I tried using the expression

=Sum(Fields!TestScoreMath .Value, "table1_Group3")

How can I SUM the value of TestScore of distinct students? I need this only in SSRS.


回答1:


In SSRS 2005, this is not too easy. I would add embedded code to keep a running total. You can have the custom code to check to see if the current student ID matches the last. If so, then don't add another test score to the total. Or you could group by Student ID and call your custom code only in the header or footer of that group.

This sample shows totaling all rows: you'll need to add to this to track the studentID.



来源:https://stackoverflow.com/questions/13239408/sum-of-distinct-in-ssrs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!