Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum of filtered group in SSRS

I have applied Top N filter on 'Purchase_Amount' group so that i can get only Top N values of group but when i am applying Sum on group

=Sum(Fields!Purchase.Value, "Purchase_Amount") 

that give me sum of whole dataset so how can i get sum of filtered group ?

like image 891
Yogesh Avatar asked Nov 10 '11 04:11

Yogesh


People also ask

How do I sum in SSRS report?

In the tablix data region row group area, right-click a cell in the column group area for which you want totals, then point to Add Total, and click Before or After. A new column outside the current group is added to the data region, and then a default total is added for each numeric field in the column.

How do you use a row group in SSRS report?

Right click mouse button Select Insert -> Table - > Drag and drop the field from DataSet -> Select Data columns -> Right click on the above columns -> select Add group - > Parent Group. By default, select the Group By radio button and we need to select the dropdown list for the columns, which we are grouping.

How many variations of group filters are available in the Reports Builder?

Groups can have two types of filters: Expression — Create an expression using predefined functions and operators. PL/SQL Function — Create a custom filter.


2 Answers

You could try setting the filter on your tablix instead of the group - any sums in the tablix are then subject to that filter.

Tablix Properties

like image 156
Moby Duck Avatar answered Sep 30 '22 03:09

Moby Duck


There are many ways to address this. I would probable move the filter up the data stream, either into the query, or into the Dataset properties.

But some two other methods are described in this MSDN Community thread: Either creating a fake total row within the group members that contains the =RunningValue(...) function, and set the visibility to only show on the last row; or refer to another page item where you can get just the total of your filtered items.

like image 23
Jamie F Avatar answered Sep 30 '22 02:09

Jamie F