Assigning a field to be Null- so it doesn't show up
Assume my data set looks like the following:
I want to create a flag in the script which would allow me to use Type as a dimension, but only for certain colors. For example, I want Red and Blue to show as 'Primary', and Purple to show as 'Secondary', and for the flag to completely ignore Green or Yellow or any other Types.
I tried doing something like:
If(Type = 'Red', 'Primary', if (Type = 'Blue', 'Primary', if(Type = 'Purple', 'Secondary', ' '))) as TypeFlag
But that doesn't work- the other Types that I didn't want to Flag still are measured when I use TypeFlag as a dimension. For example, if I use the expression count(Item) I see a chart that displays:
This is even the case when I have 'Suppress when Value is Null' etc. selected.
What am I missing? How can I assign a Null value to Green and Yellow, such that when I use TypeFlag as a dimension, those items are ignored?