Sisense provides you with the ability to create logical expressions when performing custom calculations on one or more fields in your data.
For example, if you want to calculate only certain values according to conditions you define, you can use a conditional statement to include only the values of interest.
Sisense provides several conditional statements that enable you to evaluate criteria and display only the relevant results in your dashboard.
Note: Conditional states work on measures and aggregations only and return numeric values.
IF (Boolean_expression, true value, false value)
Evaluates a boolean expression and returns the first value when evaluated as true, and returns the second value when evaluated as false.
(if(Sum(Sales) < 10, 0, Sum(Sales) )
Nested IF statements are also supported.
if (Sum(Sales) < 100 , 1 ,(if (Sum(Sales) < 1000 , 2, 3) )
CASE WHEN Boolean_expression THEN result_expression [ ... ] [ ELSE else_result_expression ] END
The CASE function evaluates boolean expressions, and when evaluated as true, returns the corresponding result_expression. If no match is found, the else_result_expression is returned. If there is no default returned and no values match, then Null is returned.
CASE WHEN Sum(Sales) < 100 THEN 1 WHEN Sum(Sales) < 1000 THEN 2 ELSE 3 END
Hey! Was this article helpful?
Questions? Ask the community.