【问题标题】:Case When Statement in Google Data Studio not workingGoogle Data Studio 中的语句不起作用的情况
【发布时间】:2020-12-29 04:41:35
【问题描述】:

我正在尝试在 Google Data Studio 中创建 CASE WHEN 语句。但是,它不适用于我的桌子。我尝试了一些组合,但似乎没有任何效果。它还说语法是有效的。

【问题讨论】:

    标签: case google-data-studio


    【解决方案1】:

    可以使用下面的3个Calculated Fields来实现:

    1) 指标 (Needs Intervention)

    COUNT(CASE
        WHEN Absenteeism Avg in Days > 15 THEN "Needs Intervention"
        ELSE NULL END)
    

    2) 指标 (Stable)

    COUNT(CASE
        WHEN Absenteeism Avg in Days <= 15 THEN "Stable"
        ELSE NULL END)
    

    3) 维度 (Needs Intervention / Stable)

    CASE
      WHEN Absenteeism Avg in Days > 15 THEN "Needs Intervention"
      ELSE "Stable"
    END
    

    Google Data Studio Report 和一个 GIF 来详细说明:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-04
      • 1970-01-01
      • 2020-08-11
      • 2020-11-02
      • 1970-01-01
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      相关资源
      最近更新 更多