Conditional statement based on string values ?
AnsweredI am unable to find a way to use a conditional statement on a string field .
Ex. If [Country] ="India" then [Value] else Null
Is there a way to do it in the dashboard formula instead of writing the formula in the elasticube ?
Thanks,
Ankit.
-
Hi Ankit,
Currently front end IF and CASE statements work only on numerical numbers (not strings as you are trying to do). We are planning to add additional functionalities in future versions. Please see our documentation on the subject: Conditional Statements
Also, feel free to submit your idea in our Ideas Forum, where it can gain traction through community input and upvoting.
-
Hi All,
Just a thought here, given that CASE/WHEN statements within widget formulas aren't supported yet for strings, one can allocate a unique INT value for each of the different string values within the EC table, by adding a new column, then using the RANK() function, this way each string will be allocated it's own unique INT value, and then apply the CASE/WHEN statement on that.
Assuming the value of 'India' receives the INT of 17 then:
If( [Country_INT] =17 , [Value] , NULL )
OR
CASE
WHEN [Country_INT] =17 THEN [Value]
ELSE NULL
END
LMK if I can further clarify
Ido
QBeeQ.pl
-
Katie Garrison - is there an update on this functionality yet?
-
Hi All, just reposting my previous comment from above, as I see there's some interest on this, this solution is working for us:
Just a thought here, given that CASE/WHEN statements within widget formulas aren't supported yet for strings, one can allocate a unique INT value for each of the different string values within the EC table, by adding a new column, then using the RANK() function, this way each string will be allocated it's own unique INT value, and then apply the CASE/WHEN statement on that.
Assuming the value of 'India' receives the INT of 17 then:
If( [Country_INT] =17 , [Value] , NULL )
OR
CASE
WHEN [Country_INT] =17 THEN [Value]
ELSE NULL
END
LMK if I can further clarify
Ido
QBeeQ.pl
Sisense Partner of the Year 2019!
Please sign in to leave a comment.
Comments
20 comments