create simple case statement in custom dimension or table calculation.

Why is it so hard to write a simple case statement in custom dimension or table calculation. Can some one help me understand how to achieve this simple task without editing LookML ?
scenario :

i have 4 CUSTOM Measures:

US_2020_rev , US_2021_rev,  CANADA_2020_rev, CANADA_2021_rev

Now imagine a person without developer access is editing the explore. I want to do the following:

case when ( (US_2020_rev is Null AND US_2021_rev > 0) AND ( CANADA_2020_rev is NULL AND CANADA_2021_rev is NULL) ) then “US-2021-Product” else “” END

I add this in the custom dimension or table calculation i get error. How can a non-developer access person achieve this in looker explore ?

1 1 2,847
1 REPLY 1

What code exactly do you use in Table Calculation? Can you show us? You are right to use Table Calculation for it. Custom Dimensions can’t take measures of any kind as far as I know.

Top Labels in this Space