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.  opens KOSMIQ with the help articles on variables.
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 the variables of the phases on the timeline. - **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
Your own groups are listed below the line, in alphabetical order. If you press the space bar while a group is selected, KOSMA clears the selection and shows this message instead of the variables:
Select a group to see its globals
Under **Groups**, click . 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 `_`. Replace New Global: a formula cannot use a name with a space. | | **Comment** | What the value means, for example "Per diem per person and day". Up to 100 characters. | | **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. |
**Value** shows the result. **In Use** shows how many formulas use the variable. This also applies to `NPC`, `GT` and `DFFF`. For the rows of **Work Phases**, **In Use** always shows 0, even if a formula uses them.
A shorthand name can exist only once in the budget. It cannot consist of digits only. KOSMA does not save such a 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 that makes variables depend on each other in a circle. If the formula of a variable uses account sums and a budget line uses that variable, KOSMA 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  to its new place.
In the variable's row, click . KOSMA dims the row and no longer offers the variable in the list that opens while you type a formula. To show it in the list again, click  in the row. To hide all variables of one of your groups, click  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 keeps its last value and no longer changes with the budget.
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 . 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
In that case, delete each variable of the group that shows more than 0 under **In Use**, or replace it in its formulas first. 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 ,  **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. In the demo project you can do every step with any licence. You can still open and read **Variables**. 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