Budgeting
You can create a group and a variable, hide or delete a variable, and delete a group.
You create a variable when you need the same value in several places in the budget. When you change the value, KOSMA recalculates every formula that uses the variable. Your own variables are in groups that you create yourself. You need an open budget.
Click  **Variables** in the toolbar, or press ⌘, on a Mac or Ctrl+, on Windows. KOSMA opens the **Variables** window with **All** selected. On the left, under **Groups**, are the groups. On the right are the variables of the selected group.
Your own groups are listed below the line, in alphabetical order. The three groups above the line are fixed. You cannot create a variable in them:
- **All** shows the variables of your own groups and of **Subtotals**. - **Work Phases** shows variables taken from the work phases on the timeline, such as the work days of a phase. - **Subtotals** shows `NPC`, `GT` and `DFFF`.
You cannot edit the rows of **Work Phases** and **Subtotals** here. Their **Calculation Formula** shows `-`, and you cannot delete them. When you point at the cell, KOSMA shows the reason. For a work phase:
Work phases can only be edited in the timeline
For a subtotal:
Hardcoded variable — cannot be edited
Under **Groups**, click  **Click to add a new group**. KOSMA adds a group, names it New Globals Group in every language and selects the name. Type a name, for example `Rates`, and press Enter. If you leave the name empty, the group keeps its previous name.
Select your group under **Groups** and click  **Variable** below the variables. KOSMA shows this button only while one of your own groups is selected. KOSMA adds a row named `New_Global` at the end of the group, with `0` as its **Calculation Formula**, and selects the name. Fill in the row:
| Column | What you enter | | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Shorthand Name** | The name you write in formulas, for example `perDiem`. Use up to 25 letters, digits and `_`. Rename New\_Global to something meaningful. | | **Calculation Formula** | A number such as `45`, or a formula such as `NPC*1.06`. A formula can use other variables, the variables of the work phases, `NPC`, `GT` and [budget functions](/kb/article/budget-functions-reference) such as `ACCOUNT`. | | **Unit** | Optional. Choose a unit from the list. | | **Comment** | What the value means, for example "Per diem per person and day". Up to 100 characters. |
**Value** shows the result. **In Use** shows how many formulas use the variable, including `NPC`, `GT` and `DFFF`. KOSMA does not count uses of **Work Phases** rows: they always show 0. A 0 on a work phase therefore does not mean that no formula uses it.
A shorthand name can exist only once in the budget, and it cannot consist of digits only. Otherwise, KOSMA does not save the name and shows one of these messages:
Name must be unique
Add a letter — a name of only digits reads as a number
KOSMA does not accept a formula with a circular reference, for example when `A` refers to `B` and `B` refers to `A`. The same goes for a formula that uses account sums if a budget line already uses the variable. KOSMA then rejects the formula and shows:
This variable depends on account sums, so using it in a budget line would create a circular reference.
If you rename a variable later, KOSMA changes the name in every formula that uses it, and the results stay the same. To change the order of the variables in your group, drag a row by its grip  to the new place.
A hidden variable no longer appears in the list that opens while you type a formula. The buttons call this list the expressions dropdown.
In the variable's row, click  **Hide variable from the expressions dropdown**. KOSMA dims the row. To show the variable again, click  **Show variable in the expressions dropdown** in the row. To hide all variables of one of your groups, click  **Show/hide group in expressions dropdown** in the group's row under **Groups**.
In the variable's row, click  **Delete variable**. If no formula uses the variable, KOSMA asks you to confirm. Click **Ok**.
If formulas still use the variable, KOSMA lists them below this message:
Are you sure you want to delete variable perDiem? Deleting it will leave the formulas below pointing at a missing element. You can delete anyway and fix them later.
If you delete a variable that formulas still use, each of these formulas has no value until you correct it, so the amounts that come from these formulas are missing from the totals.
To correct the formulas first, click **Cancel**. Click **Delete anyway** only if you correct them afterwards. KOSMA then frames each of these formula cells in red. When you point at such a cell, KOSMA shows:
Unknown part of expression
If you create a variable with the same name again, KOSMA calculates these formulas again.
Under **Groups**, select one of your own groups and click  **Click to delete the selected group**. If a variable of the group is still in use, KOSMA does not delete the group and shows this message, without naming the variable:
Some variables within the group are in use. Group cannot be deleted
Check **In Use** to see which variables of the group show more than 0. Replace each of them in its formulas, or delete these variables as in step 5. Then delete the group again. See [why some things can't be deleted](/kb/article/why-some-things-cant-be-deleted). If no variable of the group is in use, KOSMA asks:
Are you sure you want to delete selected group?
Deleting a group deletes every variable in it.
Confirm the message to delete the group.
Click **Ok**. KOSMA saves every change you made in the window and closes it. **Ok** becomes available as soon as you change something. To discard all changes since you opened the window, click **Cancel**.
**If you cannot add, hide or delete variables.** KOSMA greys out  **Hide variable from the expressions dropdown**,  **Delete variable** and  **Variable** when you cannot edit the budget. This is the case when you have a Free licence, when the budget was shared with you for reading only, when it is linked to a cost control set, or when you are not signed in. You can still open and read **Variables**. In the demo project you can do every step with any licence. When you point at a greyed-out button, KOSMA shows why. See [what your licence includes](/kb/article/what-your-licence-includes).
**Import many variables at once.** To import a rate card, click **Import From XLS**. See [import variables from a spreadsheet](/kb/article/import-variables-from-a-spreadsheet).
Markdown