Partial sum in SSRS 2008 R2

断了今生、忘了曾经 提交于 2019-12-11 18:06:24

问题


I've a column with values for each month of the year.

Then in parameters of my report i would be able to set the month.

SSRS should return this column with values for each month of the year (like if there's no parameter) but the sum at the bottom of this column should return the sum of the value from the beginning of the year to the selected month.

Is it possible?


回答1:


Yes. If I'm understanding correctly, you want something like the image below:

Assuming your MonthYear column is a DateTime and your month parameter is an Integer, you can use an expression like the following to conditionally sum the total based on the parameter value:

=Sum(IIf(Month(Fields!MonthYear.Value) <= Parameters!Month.Value, Fields!Value.Value, 0))


来源:https://stackoverflow.com/questions/24679240/partial-sum-in-ssrs-2008-r2

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