Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to work out an 'if' statement such that when one selection is made for a geography, certain values will be returned.
Lets say that we have a selection box with Geographies a,b,c,d,e,f,g.
So when a,b,or c are selected (only one can be chosen at a time), than a,b and c are all returned in my chart. This would be the same for d,e,f,g.
An example: we select 'b', then we see a,b,c.
Another example: we select 'g', then we see d,e,f,g in the chart
I know that this can be done as a conditional in the 'dimensions' tab. I am struggling with the syntax, though.
Thank You,
Try sth like:
sum({$<[Condition]={$(=if(SubStringCount([Condition],'a') or SubStringCount([Condition],'b') or SubStringCount([Condition],'c'),chr(39)&'a'&chr(39)&','&chr(39)&'b'&chr(39)&','&chr(39)&'c'&chr(39),
chr(39)&'d'&chr(39)&','&chr(39)&'e'&chr(39)&','&chr(39)&'f'&chr(39)))}>}
[Field to sum])
This was helpful. But is there a way to reduce the syntax.
What I am trying to say is:
When select value in ('a' or 'b' or 'c') then 'a,b,c'
When selected value in ('d' or 'e' or 'f' or 'g') then 'd,e,f,g'
The syntax is that long because you need to have {'a','b','c'} not 'a,b,c'.
Each value must be quoted and you cannot write in that inside if statement ''a','b','c''
Replacing ' with chr(39) will work fine.
At least I cannot think of shorter version now, hope somebody will help