[英]SSRS grouping chart by parameter
您可以对group by
使用表达式:
select (case when parameter = 'City' then city
when parameter = 'Country' then country
end) as which,
sum(value)
from t
group by (case when parameter = 'City' then city
when parameter = 'Country' then country
end);
也就是说,我认为您应该在SSRS中针对不同的值分别查询。 这样的参数化查询更难优化和维护。
假设您的参数值为0和1,其中0 =国家和1 =城市...。您只需要设置以下各项
Group On
表达式 Sort by
同样的表情,像这样...
=IIF(Parameters!groupColumn.Value =0, Fields!country.Value, Fields!city.Value)
它在所有三个地方的表达完全相同。
如果您无法正常工作,请告诉我,我将举一个示例,但这很简单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.