在查找中使用聚合函数

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

我正在使用Report Builder 3,并且在选择所有多值参数选项时,折线图无法显示正确的图形时遇到了麻烦。

我最初遇到的问题是x轴没有显示没有数据的所有月份,因此我创建了一个'months'数据集,并将其用作图表上的类别组并使用'Lookup在我的系列价值中。如果我仅在参数中选择单个值,但是当我“全选”时,这就会出错。

enter image description here

我在表达式(下面)中添加“ Sum”是我认为可以解决问题的方法,但这不起作用

=Lookup(Fields!yyyy_mm.value,Fields!yyyy_mm.value,Fields!sum(All_Attended.value),"All_Attended")

我也看过使用'lookupset',但这也不起作用

=sum(Lookupset(Fields!yyyy_mm.value,Fields!yyyy_mm.value,Fields!sum(All_Attended.value),"All_Attended"))

我的数据集查询看起来像这样

select

 Fiscal,[yyyy_mm],localauthority,ward,
 sum(case when Field = 'ABC' then 1 else 0 end) as ABC,
 sum(case when Field = 'DEF' then 1 else 0 end) as DEF,
 sum(case when Field in ('ABC,'DEF') then 1 else 0 end) as All_Attended

 group by Fiscal,[yyyy_mm],localauthority,ward

数据看起来像这样

 Fiscal      yyyy_mm      localauthority    ward   ABC  DEF   All_Attended  
 15/16       2015-07         east          hampton  5    5        10
 16/17       2016-01         north          dale    2    2        4
 16/17       2016-01         north          port    1    0        1

这些是我的参数enter image description here

这是运行时的报告,如您所见,我应该期望图表中的数字更大。

enter image description here

我正在使用Report Builder 3,并且在选择所有多值参数选项时,折线图无法显示正确的图形时遇到了麻烦。我最初遇到的问题是...

visual-studio-2012 reporting-services visual-studio-2015 reportbuilder3.0
1个回答
0
投票

已经设法找到了具有答案的网站。不确定是否可以发布指向其他网站的链接。该解决方案需要一些VBA代码。

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