IF Statement That Returns Any Text

How to create an IF statement to return any text on your dashboard.

Last updated: July 16, 2021

IF statements allow the formulas to make logical comparisons between a value and an expected outcome. You can use IF statements to return any text on your Plecto dashboard. For example, if your team is working towards a target, you can create a formula that returns "Good job" once they reach it.

Dashboard inspo.png

An example of a table widget displaying text based on IF statements in the columns "Target Reached?" and "Text."

IF statements with text allow the employees to see your message once they fulfill a condition, for example, a "Yes" or "No" for reached targets, a cheerful "Good job," or a special status message for outstanding performance.

Dashboard - Whos the best - I am.png

An example of an IF statement returning "I am!" on a table widget.

You see that it is possible to return any text on your dashboard based on the conditions you set up in the IF statement. Make sure to set the number formatting to "Text" in the formula editor to ensure that the widget displays your message correctly. You can also use conditional colors to customize the look of your message.

Here's how you build the formulas from the examples above:

  • IF statement that returns "Good job" if the target is reached. If the target is not reached, the statement will not return any message.
(
    IF(Sum(<data_source>,<filters>,Field)>Target,"Good job","")
)
IF statement - text.png

An example of an IF statement created based on a data source called "Sales" and its field "Amount."

  • IF statement that returns "I am!" for an outstanding target of 150.000. If the target is not reached, the statement will not return any message.
(
    IF(Sum(<data_source>,<filters>,Field)>Target,"I am!","")
)
Screenshot 2020-11-18 at 07.35.06.png

An example of an IF statement created based on a data source called "Sales" and its field "Amount."

Read more: Learn how to create an IF statement that returns 100% if the results are greater than 100%.

Was this article helpful?