Creating conditional total rows in SSRS

匆匆过客 提交于 2019-12-24 04:58:10

问题


I am creating a report that has to mimic and existing report… it has grand totals and subtotals.

Problem is the subtotals are based on different criteria…

So:

Apples           5
Oranges          6
Beans            3
Grapes           8
Peas             3

Total Fruit:    19
Total Veggies:  6
Grand Total :   25

Assuming I have a field that tells me if an item is Fruit/Veggie, how can I create grand subtotal row (at the bottom of the page) that will only add based on the value of another field?

I do not want separate groups. The format should remain as is.


回答1:


Add calculated fields to the underlying dataset that total Fruit and Veggies separately. That way the appropriate sub total can be based on the calulated field.

If you had a field that was ItemType, containing "Fruit" and "Vegetable", you could create a function like =Sum(Iif(Fields![ItemType]="Fruit",1,0)) to sum only the fruit.



来源:https://stackoverflow.com/questions/4472571/creating-conditional-total-rows-in-ssrs

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