2014-07-23 103 views
0

我給出了結合查詢使其成爲儀表板中的儀表板的任務.. 這樣的事情。施加結合查詢,使其成爲儀表板中的儀表板

如何可以將它們組合起來成儀表板..

Total_count total_active total_inactive Active% inactive% 
100   20   80    0.5  0.8 

上述結果是通過執行單獨queries..with濾波器得到:

select count(id) from table -- gives me 100(Total_count) 

select count(id) from table where status like '%Active%' --gives me 20(total_active) 

(Total_count)-(total_active) gives me inactive.. 

Active%=total_active/Total_count 

Inactive%=total_inactive/Total_count 

但我我無法投入01​​

how do i get Total_count and Total_active in one sheet

當我在狀態列上創建一個過濾器(活動)..它也適用於Total_count呢?

is it possible to create calculations across sheets?

say in sheet i got count(total_customers) in another sheet i got count(Active_customers) 
now i need to substract values from these 2 sheets how do i do it? 

回答

1

慢下來,你。你爲什麼要查詢?您可以用簡單的方式在Tableau中進行所有這些計算(實際上它不涉及公式)。

所以,我想你的表看起來像(糾正我,如果我錯了,我可以幫你更好的):

ID狀態 1活動 2個非 3活動 4無效

只需在Tableau上連接到此(不要詢問任何內容)

因此,有很多方法可以在圖表上顯示此信息。我要做的是將狀態放在列中,並在行中添加Sum(記錄數)(只需將記錄數拖到行中,它會自動將其測量爲總和)。如果您有重複的Id條目,則可以使用Countd(記錄數),再次拖放,然後選擇countd measure。

對於%,我只是將其包含在標籤中。首先,我將SUM(記錄數)拖放到標籤上(按住ctrl鍵,以免從圖表中丟失)。然後我會添加一個表格計算:總數的百分比。這將顯示其各自列中的活動ID和無效ID的百分比。

如果您想保留絕對值和百分比值,只需拖動兩個標籤,然後根據需要進行編輯(我通常將絕對值設置爲上面的值,括號內的值爲%)。