Formulas for components and bands
Calculate a component's value or a pay band value with a formula, and set fallbacks.
Written By Karl
Last updated 5 days ago
Formulas let Evenpay calculate a value instead of you typing it in, for example an allowance based on working hours or a band minimum based on another figure.
Who can do this: Administrators.
Where formulas are used
Salary components: in the component editor, choose Calculated from a formula.
Pay bands: each band value (Min, Mid, Max) can be Static or Formula. See Creating pay band rules.
Write a formula
Open the Formula Configuration editor.
Use the Variable picker to insert values such as other components or employee fields.
Use the Functions picker to add calculations.
Use Test with sample values to check the result before you save.
Set Fallback values for when the formula can't be calculated, for example because a value is missing. A fallback can be a Fixed value or a Range.
Save.
How formulas are written
Put variables in curly braces, for example
{base_salary}. The Variable picker inserts them with the right key for each component and field.Calculate with
+,-,*,/,%(remainder) and^(power), and use brackets to set the order.Compare with
==,!=,<,<=,>and>=. Combine conditions withand,orandnot, or with&&and||.Write text in double quotes, such as
"Night", and decimals with a point:0.1, not0,1.A component formula must produce a number.
Variables you can use
How custom field values are read
Number fields give their number. A Percentage field gives a decimal: 10% is read as 0.1.
Yes/No fields give 1 for yes and 0 for no.
Option fields give the option's Value if it has one. Otherwise they give the option's name as text, which you can compare, for example
{cf:org_unit:Shift pattern} == "Night".Text fields can't be used in component formulas.
Write the field name exactly as it is spelled, including spaces and capitals. A field whose name contains a colon (:) can't be used.
To vary pay by organisation unit or job family, use a custom field on the organisation unit or job family. The
{position:orgUnit},{position:jobFamily}and{job_level:code}variables are internal codes, not names, so they can't be compared with text.
Functions
Amounts, frequencies and missing values
Component variables and pay band values are monthly amounts.
Write the result in the component's Payment Frequency. For an Annual component, the formula gives the yearly amount, such as
{base_salary} * 12 * 0.1, and Evenpay converts it to monthly.Results are rounded to two decimals.
When a value the formula needs is missing, for example the employee doesn't have that component or a custom field is empty, the calculation can't finish and the fallback is used. Use
ISBLANK,COALESCE,MIN,MAXorCLAMPto handle missing values yourself.With a Range fallback, Evenpay uses the middle of the range.
Example formulas
Replace the component keys and custom field names with your own. The Variable picker shows the exact keys.
Pay band formulas
Band formulas are simpler. They can use the tier and band values of the job grade and job level the rule matches on: {job_grade:tier}, {job_grade:salaryBandMin}, {job_grade:salaryBandMid} and {job_grade:salaryBandMax}, and the same with job_level. The functions are MIN, MAX, ROUND, FLOOR, CEIL, ABS, IF and PERCENT.
The rule needs a Job Grade or Job Level dimension. If it names several, the first one is used.
If a value the formula uses isn't set, the band value stays empty.
Examples:
{job_grade:salaryBandMin} * 1.1,ROUND({job_grade:salaryBandMid} * 0.9, 0)andIF({job_grade:tier} >= 5, {job_grade:salaryBandMax} * 1.05, {job_grade:salaryBandMax}).
Getting help from an AI assistant
To have an AI assistant draft a formula, give it this article, what the component should pay, its Payment Frequency, and the component keys and custom field names from the Variable picker. Don't share employees' pay data. Paste the result into the editor and check it with Test with sample values before you save.
A simpler option for percentages
If a component is just a share of another one, use the Percent of another component value shape instead of a formula. See Value shapes: ranges, units, in-kind benefits and equity.
Good to know
Changes made by formulas appear in employee history with the source Formula.
Always set a fallback, so employees with missing data still get a sensible value.