Formula Builder
How to use the visual formula builder to configure salary calculations.
The Formula Builder provides a visual interface for building salary calculation formulas. Instead of writing complex formulas manually, you select components, operators, and values to construct the calculation logic for each salary schema.
Available Component Types
The formula builder organizes components into three categories, each color-coded for easy identification.
Earning Components (Green)
These components add to an employee's gross pay:
| Component | Description |
|---|---|
| Basic Salary | Fixed monthly salary amount. This is the foundation of most salary schemas. |
| Commission | Variable earnings based on revenue or performance. Primarily used in driver schemas. |
| Allowances | Fixed additional payments such as housing, transport, or meal allowances. |
| Overtime Pay | Calculated from the number of overtime hours worked beyond the standard schedule. |
| Bonus | One-time or periodic bonus payments added to gross pay. |
Deduction Components (Red)
These components reduce gross pay:
| Component | Description |
|---|---|
| Income Tax | Tax withholding amount based on applicable tax rules. |
| Social Security | Employee contribution to social security. |
| Custom Deductions | Any additional deductions you have configured (e.g., uniform fees, transportation charges). See Deduction Components for details. |
System Variables (Blue)
These are dynamic values the system calculates automatically based on employee activity:
| Variable | Description |
|---|---|
| Revenue | Total revenue generated by the employee during the pay period. Commonly used for driver commission calculations. |
| Trip Count | Number of trips completed during the pay period. |
| Working Days | Number of days the employee worked during the period. |
| Overtime Hours | Number of hours worked beyond the standard schedule. |
Building a Formula
To build a salary formula:
- Click on components from the palette to add them to the formula area.
- Use operators to define relationships between components:
+(add) -- Combine earning items-(subtract) -- Apply deductionsx(multiply) -- Calculate percentages or rates/(divide) -- Split values
- Use parentheses
( )to group parts of the formula and control calculation order. - Enter numeric values where needed (e.g., fixed amounts, rates, multipliers).
- Preview the result to verify the formula produces the expected output.
Example Formulas
Staff Salary (Fixed)
A straightforward formula for office staff with a fixed salary:
Basic Salary + Allowances - Income Tax - Social SecurityThis takes the base salary, adds any fixed allowances, and then subtracts tax and social security contributions.
Driver Salary (Commission-Based)
A more complex formula for drivers whose earnings depend on revenue:
(Revenue x Commission Rate) + Base Pay + Allowances - Income Tax - Social Security - Loan RepaymentThis calculates commission from revenue, adds a base pay and allowances, then subtracts all applicable deductions.
Staff with Overtime
For staff who are eligible for overtime pay:
Basic Salary + Allowances + (Overtime Hours x Overtime Rate) - Income Tax - Social SecurityCommission Tiers
For driver-type schemas, you can define tiered commission rates based on revenue ranges. This means drivers earn higher commission percentages as they generate more revenue.
How Tiers Work
Each tier defines:
- Minimum revenue -- The lower bound of the revenue range
- Maximum revenue -- The upper bound of the revenue range
- Commission rate -- The percentage applied to revenue within this range
- Subsidies -- Optional dynamic subsidies (fuel, tolls, etc.) included at this tier
Example Commission Tiers
| Revenue Range (AED) | Commission Rate | Subsidies |
|---|---|---|
| 0 -- 5,000 | 15% | Fuel subsidy |
| 5,001 -- 10,000 | 20% | Fuel subsidy, Toll subsidy |
| 10,001+ | 25% | Fuel subsidy, Toll subsidy, Maintenance subsidy |
In this example, a driver who generates AED 12,000 in revenue would earn:
- 15% on the first AED 5,000
- 20% on the next AED 5,000
- 25% on the remaining AED 2,000
Setting Up Tiers
- In the salary schema editor, navigate to the Commission Tiers section (available for driver schemas only).
- Click Add Tier to create a new revenue range.
- Enter the minimum and maximum revenue values.
- Set the commission rate percentage.
- Optionally add subsidies that apply at this tier level.
- Repeat for additional tiers.
Test your formula with sample values before assigning it to employees. Incorrect formulas will affect all assigned employees' payroll calculations. Use the preview feature to verify results with realistic numbers.
Tips for Building Formulas
- Start simple -- Begin with the basic components (salary + allowances - deductions) and add complexity as needed.
- Use the preview -- Always preview your formula with sample data to verify it calculates correctly.
- Check parentheses -- Make sure grouped calculations are enclosed in parentheses so the order of operations is correct.
- Name schemas clearly -- Use descriptive names like "Driver Standard Commission" or "Office Staff Basic" so it is easy to identify what each schema does.