*This feature is included from the Pro Plan and up.*

*Reach out to our support team if you'd like to try it out.*

Formulas represent the Data center feature that helps you shape your data with mathematical operations.

While the concept is based on simple operations with elements and data available on your portal, the result can be a complex custom metric tailored specifically for you and your organization.

## Creating Formulas

Formulas are very similar to Data sets when it comes to the way they are set up.

From **Reports** > **Data center **> **Formulas** > **Create**, and follow the same first steps:

give your metric a

**name**: this is used to find it later in the list of metrics availablegive your metric an

**ID**: this is used to reference your metric in other formulas. Remember that an ID can only be written with uppercase letters and underscores (Planday will format your ID the correct way where necessary).set a

**unit**for your metrics: the type of unit you choose will affect how your metric is displayed in your schedule.

More info about the basic elements of a metric can be found in the Data metrics article.

Once you click **Next**, you will find yourself on the advanced settings page for your **Formula**. This is where you can set up mathematical operations with:

data from your

**Schedule**(e.g assigned Shift hours or the total number of assigned shifts ),**Data set**(more details here),and/or other

**Formulas**.

The top field is where you can create the formula for your metric.

*Please note, that you can only add and edit things in order: elements are always added at the end of the formula and editing always starts from the last element (or most recently added). *

To create your formula, simply type or click on the components you need. Those can be:

**numeric values****mathematical operators**from underneath the formula field.

`"+" for addition `

"-" for substraction

"*" for multiplication

"/" for division

"(" and ")" to set the order of operations.

**available metrics**, which lists IDs for all the metrics you have created previously.*This highlights the importance of choosing intuitive and explanatory IDs for your metrics, as this is the only information displayed.**For instance, from the 4 available metrics in the example below, the #SHIFTS_NEEDED ID is well set. In contrast, the #PAYROLL_SUPPLEMENT ID is not indicative of what kind of data it brings which can be anything from the actual amount added to the payroll to a percentage and could be set per hour or per shift.**Having good IDs can save you a lot of time.*

**Schedule data**, which provides a list of all the data that you can use. You can always find a component for Schedule data to make it match your operations and the other elements in your formula, with the many variations available.

For instance, if want to create a formula between 2 metrics with data per hour, you should choose the Schedule element that contains the data you need, listed hourly.

### Understanding the Schedule data available for Planning metrics

All the Schedule data components contain information about shifts, in different states, and from the different levels of your Schedule. Here's the complete list:

You can also hover on top of any component for actual values from your Schedule to get a full explanation of what it will bring to your formula, as shown below:

Once you're familiar with the Schedule data available, you can also use the filters available to narrow down the list:

*Data return type*: filters based on whether the data should be gathered as**hour count**or as**shift count**.*Data gathering level*: allows you to chose whether the data should be grouped by**Department**,**Position,**or**Section**.*Shift status*: makes the distinction between the data based on**Open**or**Assigned**shifts.*Data displayed*: regardless of the data return type (how the data is collected and grouped), data can be displayed**daily**or**hourly.**

When no filter is applied (** None** is selected for all the filters), you will see the complete list. Similarly, when a filter is set to

**, it is simply not applied to your list.**

*None*As an example, the formula below has 3 parts:

a component for actual values for Schedule data, that is gathering the total number of hours in assigned shifts, by Department, per hour

the "-" operator

a self-made metric that contains the total number of hours worked (e.g. approved from Punch Clock entries).

This formula would then calculate the difference between the total number of assigned (shift) hours and the total number of actual worked hours, and show in the Schedule.

This can be useful if the number of hours worked depends on how many customers you have at a given time. This way you can quickly spot the periods where you might have scheduled too many employees or too few.

Once you've set up the formula, just click "Next" to continue to the Schedule settings of your metric.

The main difference between a Data set and a Formula is the option to display it as a Planning metric in your Schedule.

When assigning your metric, you'll need to keep in mind that the components for gathering Schedule data used in your formula will be affected by what you choose.

Formula metrics can only calculate data for Sections and Positions in a department. If your formula uses actual values from your Schedule data do not assign it globally or to a Department.

You will need to make sure that the components you used and the settings you apply will match, so your metric calculations will appear in your schedule and show what you expect.

Think of the **Assign** option as an indicator for where the results of the formula will be displayed. With that in mind, you have to make sure that your formula is displayed in a place that matches the contents of the formula.

As a rule of thumb, formulas need to match the level of the lowest structural level contained in your metric.

The order is **Global** (or portal) → **Department** → **Section** → **Position**, following the structure used in Planday.

Now that you have set up your Formula, you're one step closer to displaying it in your Schedule. Check out this guide for the next step.