【问题标题】:Remove Duplicate Rows from SSRS Report从 SSRS 报告中删除重复行
【发布时间】:2015-08-20 08:33:40
【问题描述】:

我准备了一份 SSRS 报告,显示为

 Country    Sector
 -------    -------
 UK         banking 
 US         Banking
 US         Banking  
 Ireland    Sports   
 Ireland    Sports

我的数据集有 CompanyName、Country 和 Sector。我想将各个不同的行业名称分组到 country 下。但是我得到了如上所示的重复结果,因为所有行的公司名称都不同。我想删除这个重复项我只想显示 Country 和 Sector。请告知如何在不使用 distinct in 查询的情况下执行此操作。

【问题讨论】:

  • 请将公司名称添加到数据中。很容易理解

标签: reporting-services reporting ssrs-2012


【解决方案1】:

只需按行业和国家对数据集进行分组。

以这个查询为例:

select 'a' as company, 'UK' as Country, 'banking' as Sector
union all
select 'b' as company, 'US' as Country, 'banking' as Sector
union all
select 'c' as company, 'Ireland' as Country, 'Sports' as Sector
union all
select 'd' as company, 'Ireland' as Country, 'Sports' as Sector

你会得到这个数据集(不确定它是否和你的相似)

编辑:在国家下设置部门

如下配置行分组

你会得到这个预览:

如果它符合您的要求,请告诉我。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多