2013-09-27 179 views
0

我有SSRS 2008 R2中的列圖圖表,現在我想以百分比形式顯示值。目前它只顯示總數。我的數據集的樣子:如何在列圖圖表上創建百分比?

people_count facility met_reqs 
12 Chattanooga, TN 0 
9 Clarksville, TN 0 
6 Columbia, TN 0 
51 Chattanooga, TN 1 
22 Clarksville, TN 1 
28 Columbia, TN 1 

正如你所看到的,每個城市都有兩行:第一行是誰不符合要求,第二行是每個城市,曾經相遇請求數人的數量。

Where my last query is: 
select 
count(distinct people_id) as people_count, 
facility, 
case when total_los/total_visits *3/7 >= 1 then 1 else 0 end met_reqs 
from #final 
group by facility, case when total_los/total_visits *3/7 >= 1 then 1 else 0 end 

目前我有這個圖表顯示PEOPLE_COUNT對圖表值,類別組=設施和系列組= met_reqs的總和。

這看起來像: enter image description here

但現在對於Y軸我想這不是誰顯示符合要求的人/機構的百分比。我怎樣才能做到這一點?所以Y軸應該有0-100%的範圍。

回答

1

你有沒有考慮過100%Stacked Column chart?

enter image description here

如果您改變現有的設置,這似乎達到您的要求:

enter image description here

enter image description here

enter image description here

如果這是你沒有什麼之後,你可以請更新你的問題有更多的細節?

編輯點評

確定後,爲滿足只顯示%實現了要求的具體要求。具有相同的數據集,使用(即第一個選項)圖表類型和除去系列組

enter image description here

enter image description here

更改表達式:

=Sum(IIf(Fields!met_reqs.Value = 1, Fields!people_count.Value, Nothing)) 
    /Sum(Fields!people_count.Value) 

即獲得總數的百分比people_count其中met_reqs = 相比於每個組中總共people_count

爲了完整起見,我將Y軸上的數字格式更改爲百分比。

這看起來OK對我說:

enter image description here

希望這有助於得到一點更接近球門。

+0

謝謝。好主意,但她只想看到符合預期的%。我怎麼能這樣做? – salvationishere

+0

好吧,我已經添加了一些更多細節 - 希望這對你有用? –

+1

超級!!!這工作完美!非常感謝! – salvationishere