2015-08-20 252 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建議工作。這是我需要的確切解決方案。 –