I am trying to create a table calculation/custom field by summing up a yes/no dimension but I am not getting the desired result in my data. Below is my table calculation,
Registered_Users (Custom Field):
sum(if(${users.is_registered},1,0))
It gives the same sum for all the rows in the data which is incorrect. I wrote a case statement to mimic the above table calculation in SQL runner and I was able to get the desired result. Below is my sql case statement,
sum(case when users.is_registered=‘Yes’ then 1 ELSE 0) as Registered_Users
Can someone please help? Can i create a table calculation with the similar case statement based approach?