简体   繁体   English

SSRS-如何将组总计仅应用于某些组?

[英]SSRS - How to apply group totals only to some groups?

Product Data 产品资料
ProductA 1.55 产品A 1.55
ProductB 1.60 产品B 1.60
ProductC 1.70 产品C 1.70
ProductC 1.50 产品C 1.50
ProductD 1.40 产品D 1.40

Desired Result 所需结果

Product Name   Price
ProductA       1.55
ProductB       1.60
ProductC       1.70
ProductC       1.50
               3.20
ProductD       1.40

Total          7.75

Hello, I have a report that usually contains rows of unique products and their sales price. 您好,我有一个报告,通常包含几行独特的产品及其销售价格。 (For brevity here, I've only included 2 columns) (为简便起见,我仅包括2列)

However, occasionally a product line may appear twice on the same report (in this case, ProductC). 但是,有时一条产品线可能在同一报告中出现两次(在本例中为ProductC)。 The requirements I have are to sub total the price of the duplicate product lines, but not sub total the other product lines. 我的要求是对重复的产品线的价格进行总计,而不是对其他产品线的价格进行总计。 Obviously I can group by product name, apply a group total, but this will apply the subtotal to all the groups. 显然,我可以按产品名称分组,将总计应用于一个组,但这会将小计应用于所有组。

Any help would be appreciated. 任何帮助,将不胜感激。 Thanks 谢谢

Add your Total Row as normal then right-click the row header and set the `Row Visibility' to an expression like this 正常添加总行,然后右键单击行标题并将“行可见性”设置为这样的表达式

=CountRows() <2

This simply counts the rows in the group and it it's less than 2 rows the hidden property is set to True. 这只是对组中的行进行计数,并且少于2行(隐藏属性设置为True)。 Only groups with more than one row will have a total row displayed. 只有多于一行的组才会显示总行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM