> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-setups/setup-expressions-for-allowance-deduction-calculation.md).

# Setup Expressions for Allowance/Deduction Calculation

**Setup Expressions for Allowance/Deduction Calculation** is where you keep the **formulas** that work out allowances and deductions in payroll, each under its own name. Open it from **Payroll Setups\Setup Expressions for Allowance/Deduction Calculation**. It works on the desktop and on the web.

The grid has the columns **SNO.**, **CONFIGURATION NAME** and **EXPRESSION VALUE**.

### **Add or change an expression**

* In a new row, type the **CONFIGURATION NAME** (it is written in capitals).
* Move to **EXPRESSION VALUE** and type any character or press the space bar (on the web you can also double-click the cell). The **Script Editor** opens with the payroll fields; the allowances and deductions set up for your company are fields too. Write the formula, test it with **Script Watch** and press **Save** in the editor. See **Writing Formulas in the Script Editor**.
* The formula must store its result in the field named after the allowance or deduction it is used for, for example `DA = ...`.
* The cell shows the formula on one line; the box under the grid, headed by the row's **CONFIGURATION NAME**, shows the full formula of the row you are on.
* For a **new** row, press **Enter** on **EXPRESSION VALUE** so that a new blank row appears. A new row left without pressing **Enter** is not saved. Changes to an existing row are kept without it.
* Press **Save** and confirm **Are you sure you want to save changes**. **Close** leaves the screen.

### **Delete an expression**

* Select the row and press **F8** (or the grid's **Delete Line** button; on the web, the bin button **Delete Row**), then answer **Yes** to **Confirm Deletion**. The row is removed for good when you press **Save**.
* An expression used in a grade's allowance or deduction setup cannot be deleted: *Configuration is Linked.Can not Deleted.*

### **Messages you may see**

* *Enter CONFIGURATION NAME* - the row has no name.
* *Expression can not be blank.* - the row has no formula.
* *EXPRESSION NAME '...' already exist* - another row has the same name (the name is shown).
* *Modification rights not available.....* - on **Save**, when your user rights do not allow changes on this screen.

The first three appear when the row is completed - when you press **Enter** on the last column or move off a row you changed.

> **Example - DA for semi-skilled workers**
>
> Meena adds a row **SEMISKILLED-DA**, opens **EXPRESSION VALUE** and writes `DA = GROSS_SALARY * 0.3065` (**DA** is one of her company's allowances). She types 20000 as the test value of **GROSS SALARY** and presses **Script Watch**: **DA** shows 6130. She saves the formula in the editor, presses **Enter** on the row, and then saves the screen.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/payroll/payroll-setups/setup-expressions-for-allowance-deduction-calculation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
