2015-08-20 257 views
0

我准备这显示SSRS报告中删除重复的行为从SSRS报告

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

我的数据集有公司名称,国家和Sector.I希望将各种不同的部门名称下country.But我得到上面显示的结果是重复的,因为公司名称对于所有行都是不同的。我想删除此重复项,因为我只想显示Country和Sector.Kindly建议如何在查询中使用distinct来做到这一点。

+0

请将公司名称添加到数据中。它会很容易理解 – KrazzyNefarious

回答

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 

你会得到这样的数据集(不知道这是否与你相似)

enter image description here

编辑:国家下设置部门

配置行分组如下 enter image description here

,你会得到的这个预览:

enter image description here

让我知道它是否符合你的requeriments。

+0

感谢http://stackoverflow.com/users/2647648/alejandro-zuleta.Your建议工作。这是我需要的确切解决方案。 –