Case When Statement in Google Data Studio not working

Viewed 729

I'm trying to create a CASE WHEN statement in Google Data Studio. However, it not applying to my table. I tried a few combinations and nothing seems to work. It also says that the syntax is valid.

1 Answers

It can be achieved using the 3 Calculated Fields below:

1) Metric (Needs Intervention)

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

2) Metric (Stable)

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

3) Dimension (Needs Intervention / Stable)

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

Google Data Studio Report and a GIF to elaborate:

Related