Formulas are at the core of Plecto. Every number that is displayed on a dashboard comes from a formula. With them, you can express a wide range of calculations that should be made on your data.

Formulas are saved as plain text, however, for a it to work correctly it must follow a very specific syntax. You can think of it as a programming language. The language is similar to that of Excel or other spreadsheet software.

Your data in Excel are rows in a spreadsheet and you can filter and manipulate this data based on it's columns. Similarly, in Plecto, registrations are the rows and fields are the columns.

##

Scenario #1:

You will like to track the activity of your employees. In this case, you will like to count the **total number of sales** that your employees have done in a chosen time period.

This following example will show you how to create simple formulas directly from the dashboard or from the formula editor page.

**How to create a formula directly from the dashboard:**

- Go to your dashboard and click '
**Edit**' in the upper right. - Choose a widget (I have chosen a number box).
- If you have not yet created a formula, you can do it directly from the dashboard by clicking '
**Add new formula**'. - Select '
**Quantity**' (as I would like to count all sales made), and choose your data source. - Save it.
- Choose your time periode; day, week, month, year or custom.

How to create a formula with the simple formula editor:

- Go to '
**KPI Management**' > '**Formulas**' > '**New formula**'. - Select '
**Sum**' (as I would like to calculate the value of sales), and choose your data source. - Save it.
- Go to your dashboard and click '
**Edit**' in the upper right. - Choose a widget (I have chosen a table).
- Select your formula in the drop down list in the option box.
- Choose your time periode; day, week, month, year or custom.

##

Scenario #2:

You will like to count the number of **answered** calls that your employees have done this current year or quarter. The GIF below shows the data available in the data source '**Calls**'. We can now create a filter on answered calls:

- Go to '
**KPI Management**' > '**Formulas**' > '**New formula**'. - Select '
**Quantity**' (as I would like to count all calls made), and choose your data source. - Create a filter on '
**Disposition = Answered**'. - Save it.
- Go to your dashboard and click '
**Edit**' in the upper right. - Choose a widget (I have chosen a number box).
- Select your formula in the drop down list in the option box.
- Choose your time periode; day, week, month year or custom.

**NB.** Remember to reflect the fields in your data source; '**Disposition**' might be called something different in your set of data - maybe '**Status**'. So it is always a good idea to cross check with your data when you edit a formula.

##

Scenario #3

Now you will like to show the actual number vs. a target. The following will show you how to add a target value (in this case a static number) for e.g. the sales value.

**Do you need help? **Please do not hesitate reaching out to Support on support@plecto.com 😃