Summing conditional values in Looker Studio only shows 0 or 1

Hi!

I wanted to created custom metrics for multiple values of one of the variables so i don’t have to blend data to show them together. For this issue I wanted to create a column that shows 1 if row matches the conditions and 0 in other situation. I used the formula ‘SUM(IF((event_name=‘timer’ AND variable=‘true’),1,0))’ to sum it. Unfortunately it shows only 1 or 0 in my table - my column doesn’t sum

I also tried to use the formula without sum and aggregate it on the table-level but the result is the same

I also tried different formulas, but always with the same outcome

I’m running out of idead, would be grateful for any help that will show what am I doing wrong

Thank you!

1 Like

I think you should use the “CASE … WHEN” syntax, not “SUMIF”.

For example:
CASE WHEN XXX field = “a” THEN 1 ELSE 0 END

If you’re not familiar with this syntax, just tell GPT your sequence and condition—it will handle it well for you!

1 Like

Thanks for reply!
I’m familiar with this syntax and tried this solution

Unfortunately even with the sum aggregation on the table level, the results are the same