简体   繁体   中英

SSRS Report, Summing an Expression Column Contained in a Row Group

I have a situation that I am struggling to figure out. I have a report containing a table with 2 row groups. The dataset comes from a SQL view.
Material Type is the first row group and Material Width is the child/second. Drilling deeper I have some expressions calculating "linear feet in production" and finally "Tons of Material". The row group will show linear feet and tons of material for each material width contained within a material type. I need to get a sum total of the tons of material for each of the each material types (adding up the tonnage per different widths within the material type). Below is my expression that calculates the tons of material. Any help would be greatly appreciated as I am banging my head. Its possible I have not provided enough information so please ask for more clarification if needed. Thanks in advance to anyone that may take a look.

=
(
((Fields!MATLDENSITY.Value)/2000)
*
(Sum(CDbl(Fields!USCATVLS_4.Value))*Fields!Quantity.Value)
*
((CDbl(Fields!USCATVLS_5.Value)/12)
*
(Fields!MATLTHICKNESS.Value/12)
)
)

If I understand you correctly, you have a tablix with 2 row groups. You have an expression that works on the inner group, but you need to sum the results of that.

What you need to do is specify the scope of your expression (the scope will be you inner row group) and then sum the results of this.

Taking a simple generic example...

If you have an expression in the inner group ( myInnerGrp ) that looks like this

=SUM(Fields!qty.Value * Fields!cost.Value)

As the scope is not specified in the expression above the current scope is used, this is the equivalent to specifying the scope as...

=SUM(Fields!qty.Value * Fields!cost.Value, "myInnerGroup")

So, if you want to sum the results of this in out outer group, the expression would be

=SUM(SUM(Fields!qty.Value * Fields!cost.Value, "myInnerGroup"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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