我必须使用什么计算才能让参数在TABLEAU的并排栏上更改三个单独的列

时间:2017-08-04 18:16:25

标签: oracle tableau

我需要帮助让所有三个图表同时更改,具体取决于参数是“空闲”还是“非商业”等。换句话说,一个措施同时改变所有三个图形。我不知道该如何解决这个问题。当我试图应用我所拥有的东西时,它只给了我一个图表,当我将它从“空闲”改为“非公共汽车”等而不是三个时。

CASE [Parameter 7]
    WHEN 'Idle' 
        THEN [Idle % Phone Time]
    WHEN 'Idle' 
         THEN [Idle % Sched Time]
     WHEN 'Idle' 
         THEN [Idle % TTR Time]
     WHEN 'Non-Business'
         THEN [Non Bus % Phone Time]
     WHEN 'Non-Business' 
         THEN [Non Bus % Sched Time]
     WHEN 'Non-Business' 
        THEN [Non Bus % TTR Time]
     WHEN 'Non-Business or Idle' 
        THEN [Non Bus/Idle % Phone Time]
     WHEN 'Non-Business or Idle' 
        THEN [Non Bus % Sched Time]
     WHEN 'Non-Business or Idle'
        THEN [Non Bus/Idle % TTR Time]
     WHEN 'Business' 
        THEN [Bus % Phone Time]
     WHEN 'Business' 
        THEN [Bus % Sched Time]
    WHEN 'Business' 
        THEN [Bus % ttr]
END

1 个答案:

答案 0 :(得分:0)

select 
CASE
    WHEN  [Parameter 7] = 'Idle'  and xxxx = xxxx(about Phone_Time)
        THEN [Idle % Phone Time]
    WHEN [Parameter 7] = 'Idle' and xxxx = xxxx(about Sched_Time)
         THEN [Idle % Sched Time]
     WHEN [Parameter 7] = 'Idle' and xxxx = xxxx(about TTR_Time)
         THEN [Idle % TTR Time]
     WHEN  [Parameter 7] = 'Non-Business' and xxxx = xxxx(about Phone_Time)
         THEN [Non Bus % Phone Time]
     WHEN [Parameter 7] = 'Non-Business' and xxxx = xxxx(about Sched_Time)
         THEN [Non Bus % Sched Time]
     WHEN [Parameter 7] = 'Non-Business' and xxxx = xxxx(about TTR_Time)
        THEN [Non Bus % TTR Time]
     WHEN [Parameter 7] = 'Non-Business or Idle' and xxxx = xxxx(about Phone_Time)
        THEN [Non Bus/Idle % Phone Time]
     WHEN [Parameter 7] = 'Non-Business or Idle' and xxxx = xxxx(about Sched_Time)
        THEN [Non Bus % Sched Time]
     WHEN [Parameter 7] = 'Non-Business or Idle' and xxxx = xxxx(about TTR_Time)
        THEN [Non Bus/Idle % TTR Time]
     WHEN [Parameter 7] = 'Business' and xxxx = xxxx(about Phone_Time)
        THEN [Bus % Phone Time]
     WHEN [Parameter 7] = 'Business' and xxxx = xxxx(about Sched_Time)
        THEN [Bus % Sched Time]
    WHEN [Parameter 7] = 'Business' and xxxx = xxxx(about TTR _Time)
        THEN [Bus % ttr]
END as your_column_name
FROM your_table;

判断列的xxxx = xxxx语句,用于区分哪个条件表示该行是Phone_Time,Sched_Time,TTR_Time)