top n after adding group in tablix
-
1 พฤษภาคม 2555 11:20
I have report in which sum is calculated for each cateogary(group by cateogary).
I have to select top 10 cateogary who have max value in report.When i am using top10 filter it pick top 10 rows and so I am not gettin correct result as top n filter works before calculating sum in group.Do I need to use custom code for this??
Any suggestion.....
j
ตอบทั้งหมด
-
1 พฤษภาคม 2555 11:40
I think you'd be better off doing your aggregation and TOP 10 in SQL...
So, if you have a query at the moment which is:
SELECT column FROM Table
You'd change it to:
SELECT TOP 10 * FROM ( SELECT MAX(column) FROM Table ) T
Zach Stagers - http://www.scratchbox.co.uk
-
1 พฤษภาคม 2555 23:05ผู้ดูแล
Hi There
You can put any expression like sum etc. inside top n on group.
I have attached the screenshot for your help
Many thanks
Syed Qazafi Anjum
Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful.
- เสนอเป็นคำตอบโดย Syed Qazafi AnjumMicrosoft Community Contributor, Moderator 1 พฤษภาคม 2555 23:05
-
2 พฤษภาคม 2555 3:13ผู้ดูแล
Hi J_aer,
From your description, you want the report to display TOP 10 Category values and the total value aggregates the entire category field rather than the top 10 Category values.
To achieve your goal, you can add the filter to the group level rather than the dataset level. Please refer to the steps below:
- Right-click on the “Category” group in the Row Groups pane, open the “Group Properties…” dialog.
- Click the “Filters” tab, add a filter like the one below:
Expression: Sum(Fields!SalesAmount.Value) Interger
Operator: Top N
Value: 10
The screenshot below is for your reference:
If you have any questions, please feel free to let me know.
Regards,
Mike Yin- ทำเครื่องหมายเป็นคำตอบโดย Mike YinMicrosoft, Moderator 6 พฤษภาคม 2555 14:44