如何仅显示唯一的子项及其计数

问题描述 投票:0回答:3

我有一个带有两个字段的数据集的ssrs报告。我在字段1上分组,然后我在字段2上分组,现在我想显示子组中每个唯一项的计数。

这是数据集的样子

Route  Driver
A      Adam
A      Adam
A      John
B      Adam
A      John

and so on

这就是我想让报告看起来像的样子


Route    Driver    Count

A

         Adam      Count of number of times Adam appears in this child group.
         John      Count of John
         Total    total for all


B      
         Adam      25
         Mike       5
         Total      total


C

         Josh       10

and so on

但是,这就是它目前的样子。

Route    Driver    Count

A

         Adam      count
                   count
                   count
                   count
                  continues till the number of times Adam appears




B      
         Adam      25
                   25
                   25
                   25
                   continues 25 times

         Mike       5
                    continues 5 times


C

         Josh       10 
                    continues 10 times



这是我的设计视图

enter image description here

有关如何做到这一点的任何建议?我也愿意修改我的数据集。

reporting-services ssrs-2012 ssrs-tablix
3个回答
2
投票

插入矩阵,添加路径和驱动程序作为行组。在最右边的列中输入表达式:=count(Fields!Driver.Value)

design view

report view


1
投票

@Caesar Tex,将每个路由的驱动程序总数添加为标题:

change your report design to this

Report will look like this:


0
投票

在您的表中,您应该有两个级别的分组 - 在路线上然后在驱动程序上 - 并且没有详细信息行。 Route组有行标题的标题和小计的页脚,Driver组可以只有页脚行,不需要标题。

然后在每个组页脚上都有你的Count表达式。

© www.soinside.com 2019 - 2024. All rights reserved.