Budgeting
You know what a variable is, which kinds KOSMA has, and in which fields you can use one.
A variable is a value with a name. You enter the value once in the **Variables** window and write the name in the budget instead of the number. When you change the value, KOSMA recalculates every formula that uses the name. To open the window, click  **Variables** in the toolbar.
An example from the demo project: in the budget Demo Feature, the variable `crewBaseRate` has the value 1000, the weekly base unit for crew wages. The budget uses it in 18 formulas. If you change `crewBaseRate`, KOSMA recalculates all 18. **In Use** shows how often the budget uses a variable.
A variable contains a number or a formula that calculates one. **Value** shows the number or the result. In the budget How KOSMA Calculates of the demo project, `dayRate` is 250 and `shootDays` is 4. Account 105 calculates its total of 1,000 from these two variables.
Under **Calculation Formula**, the formula of a variable can use other variables, `NPC`, `GT` and budget functions such as `ACCOUNT`. It cannot use the variable itself, or a variable that leads back to it. For the rules of a formula, see [write a formula](/kb/article/write-a-formula).
The **Variables** window lists the groups **All**, **Work Phases** and **Subtotals**. Your own groups follow in alphabetical order. In your own groups, you enter rates, counts and planning figures yourself. To create, change or delete your own groups and variables, see [create and organise variables](/kb/article/create-and-organise-variables).
In **Work Phases**, KOSMA shows two rows for each phase of the timeline: `<Phase>_TD` with all days of the phase and `<Phase>_WD` with its work days. In a formula, you write `<Phase>_duration` for all days and `<Phase>_workdays` for the work days. KOSMA also accepts the spellings from the window. Every new budget has the phase Shooting with 26 days, 20 of them work days, so `Shooting_workdays` is 20 until you change the timeline. For examples, see [use phase durations in formulas](/kb/article/use-phase-durations-in-formulas). When you point at one of these rows, KOSMA shows why you cannot change it here:
Work phases can only be edited in the timeline
In **Subtotals**, KOSMA calculates `NPC` and `GT` from the budget. `NPC` is the net production costs: the total of all accounts, collect accounts included, markups excluded. `GT` is `NPC` plus all markups. **Subtotals** also lists `DFFF`. To set up the DFFF grant, see [set up the DFFF for a German production](/kb/article/set-up-the-dfff-for-a-german-production). When you point at one of these rows, KOSMA shows:
Hardcoded variable — cannot be edited
A **Subtotal** row that you add in the budget is not a variable. It does not appear in the **Variables** window, and no formula can read it. To use the sum of several accounts in a formula, create your own variable with `ACCOUNT`, for example `ACCOUNT("3.01")+ACCOUNT("3.02")`.
You can write a variable in these fields:
- **Quantity**, **Price/Unit** and **X** of an account or subaccount - **Base** of a markup - **Quantity** and **Price** of an extra cost in **Extra Costs** - **Factor** of an extra cost or a wage supplement that you apply to an account - **Calculation Formula** of another variable
The field **Timebase (days) for fringe limits** accepts no variable. You cannot use a variable whose formula uses `NPC`, `GT` or an account sum such as `ACCOUNT` in an account, a subaccount, the quantity of an extra cost or a fringe. KOSMA does not save such a change. For examples, see [use variables in a budget](/kb/article/use-variables-in-a-budget).
Choose names that say what the value is, so that others can follow the budget, such as `perDiem` and not `p1`. Under **Comment**, write what the value means.
Markdown