IF Statement That Returns Different Static Numbers

A guide on how to create an IF statement so that the formula shows different static numbers on different days.

Last updated: Sept. 8, 2022

You can use the custom workday parameter in the Advanced formula editor to create a formula that shows different static numbers on different days. In this case, the formula would not reflect the working days, but it would use the parameter to tell Plecto what values it should display on what days.

The parameter is binary (it consists of 0's and 1's) where

0 represents a workday AND
1 represents a day free from work.

The parameter requires a total of 7 digits, one digit per weekday. The typing order in the formula goes from Monday to Sunday. For more information, read our article on custom workdays.

Say you want the widget to show 555 from Monday to Thursday and 80 from Friday to Sunday.

  1. Go to KPI management > Formulas > + New formula > Switch to advanced editor.
  2. Copy the following formula and paste it into the editor.
(
    IF(NetWorkDays(StartDate(),EndDate(),1111000)>0,80,555)
)

Here's how the formula looks on a table widget. The data is grouped by time.

Custom static targets
Learn more about the table widget

Go to this article to learn about how to work with the table widget on dashboards.

Was this article helpful?

Please leave a comment to help us improve.