**Summary:**

How calculation fields work in P2P.

**Instructions:**

How To make a calculation Field:

- Click the dimension or measure you want to include in the calculation.

Popup will appear, where you can type the name and the formula

- Click the small arrow on the right to open the formula pane. All the available formulas are grouped by the area. You can also see the examples of the formula.

Calculate difference between 2 dates:

- Difference in days between [Creation Date] and [Due Date]
- DATEDIFF(date_part, date1, date2, [start_of_week])

Logical Expression:

- If days from creation till due are over average cycle time days the invoice is arrived on time otherwise the invoice arrived late
- IF [CalculatedFieldExercise7] >= [Cycle time in days] THEN ‘Arrived On Time’ ELSE “Arrived late” END

- Used to do something based on 1 value:
- Set target for each Company > Check your calculated field.

- Used to check is field is empty:
- Check if Payment Date is Empty > Return true or false.

Aggregated function:

- Used to fixed an aggregated field:
- Sum the [Number of Records] on Company, no matter what is selected.