Aleksandar Nakevski
Aleksandar Nakevski

Reputation: 1

Google Data Studio failed to parse a CASE statement

I am trying to sum up a variable CMTAMT_OVRD based on the Fake Date variable to create a new variable. This is the formula I am using below.

CASE
  WHEN Fake Date = 20181231 THEN SUM(CMTAMT_OVRD)
END

Fake Date is a date field in YYYYMMDD

CMTAMT_OVRD is a metric

I have already tried:

  1. Changing the data format in sheets to match;
  2. Splitting it up into different lines;
  3. Adding an else at the end.

None of the above was working.

Failed to parse CASE statement. Is what it gives me every time or Invalid Formula.

Upvotes: 0

Views: 1351

Answers (1)

Bobbylank
Bobbylank

Reputation: 1946

Try moving the aggregation outside of the case statement

sum(Case when Fake Date = 20181231 then CMTAMT_OVRD End)

Upvotes: 1

Related Questions