开发者

Filtering a Report Group in SSRS

开发者 https://www.devze.com 2023-03-21 05:36 出处:网络
I have denormalized dataset: ID, PaperId,PaperTitle, IsDelivered,IsRejected 1123AAA11 2123AAA10 3111BBB10

I have denormalized dataset:

ID, PaperId,    PaperTitle, IsDelivered,    IsRejected
1   123         AAA         1               1
2   123         AAA         1               0
3   111         BBB         1               0
4   111         BBB         1               0
5   123         AAA         1               0
6   155         CCC         1               0
7   123         AAA         1               1
8   155         CCC         1               0
9   155         CCC         1               0

I have grouped at the table level based on PaperId - to sum "IsDelivered - IsRejected" for Evrey Paper:

PaperTitle, Count (IsDelivered - IsRejected)
AAA         2
BBB         2
CCC       开发者_StackOverflow社区  3

Now how do I add filters to this group? Lets say I just want to see top 1 paper - based on the "count":

PaperTitle, Count (IsDelivered - IsRejected)
CCC         3


You can add a server-side filter.

For top-n filter, add parameter @TopCount and convert your dataset query into an expression. Something like:

="SELECT TOP " & @Parameter!TopCount.Value & " PaperTitle, CountValue FROM PaperTable ORDER BY CountValue"

HTH.

0

精彩评论

暂无评论...
验证码 换一张
取 消