IF Statement That Returns Text
IF statement example that returns text
(
IF(Sum(Sales,State="success",Amount)>=50000,
"Target Reached",
"Working on it"
)
)
Show any text when a statement condition is met. Let's break down the statement from the example above.
-
IF – the data function.
-
Sum – the name of the data lookup.
-
Sales – the name of the data source.
-
State="success" – filter. The filter includes the name of a data source field and the filtering condition. This formula will only sum the values from those registrations where the field's State values are "success." Filtering is case-sensitive.
-
Amount – the name of the field whose values will be summed.
-
50000 – target value.
-
Target Reached – if the sum is greater than or equal to 50 000, the widget will display this message.
-
Working on it – if the sum is less than 50 000, the widget will display this message.
You can add conditional colors. For example, type in Target Reached for green and Working on it for yellow.
Keeping a blank field
(
IF(Sum(Sales,State="success",Amount)>=50000,
"Target Reached",
" "
)
)
If you don't want to display a message when the target is not reached, you can leave empty quotation marks in the statement, like this: "Target Reached"," ".
There needs to be a single space between the quotation marks – otherwise, the dashboard will show 0 instead of not showing anything.