Skip to main content

How to create a formula

  1. Go to Formulas > + New formula.

  2. Give your formula a title. You'll be able to find the formula by its title in the formula list, on dashboards, in reports, and other places where formulas are used.

  3. Click + New component. You can add as many components as needed.

  4. Choose what your component should do. To calculate data from a data source, choose Data function (top-left corner). You can also use an existing formula, create a group (parentheses), add a date function, or enter a static number.

  5. If you chose Data function, the next step is to select a Function. This will tell Plecto how to calculate your data.

  1. (Optional) Adjust the Date field. By default, the formula will refer to the default date fields of the used data sources, but you can change that in each individual formula.

  2. (Optional) Click + Add filter to get specific data. For example, to only see the number of outgoing calls.

  3. (Optional) Repeat steps 3 – 7 if needed. Feel free to combine data from different data sources.

  4. Check the Number format. If you expect to see text, percentage, date, duration, or other formats on a widget, make sure to choose the matching number format.

  5. (Optional) Add conditional colors. For example, if you add 0 (red) – 50 (yellow) – 100 (green), the widget will show your data in red between 0 and 49, yellow between 50 and 99, and green when you reach 100 and more.

  6. (Optional) Add a prefix of suffix.

  7. Click Save to finish.

What are the different functions?

Data functions tell Plecto how to calculate your data:

  • Sum of sums all the values from a specific field in a data source. For example, if you want to calculate the total value, you should use this function.

  • Number of calculates how many registrations there are in the data source.

  • Number of unique calculates how many unique registrations there are in a specific field in a data source. For example, if there are 2000 registrations of the products you've sold, but you only sell 3 different kinds of products, the formula will return 3.

  • First will find the very first (oldest) registrations in your data source.

  • Last will find the latest (newest) registrations in your data source.

  • Min will find the smallest value in a specific field.

  • Max will find the highest value in a specific field.

  • Avg will calculate the average value from a specific field.