Budgeting
You can import a rate card from a .csv or .xlsx file into one of your variable groups and choose which column becomes the name, expression, comment and unit.
Import a rate card or price list from a spreadsheet as a group of variables instead of typing every row. You can then use these variables in formulas, for example in the **Price** of an [extra cost](/kb/article/define-extra-costs). You need an open budget that you can edit. The import also works offline; KOSMA syncs the variables once you are back online.
Click  **Variables** in the toolbar, then select one of your own groups under **Groups**. To create a group first, see [create and organise variables](/kb/article/create-and-organise-variables). While **All**, **Work Phases** or **Subtotals** is selected, **Import From XLS** is greyed out.
If **Import From XLS** stays greyed out with your own group selected, you cannot edit this budget, for example on a Free licence or in a budget shared with you read-only. See [what your licence includes](/kb/article/what-your-licence-includes).
If your file is an `.xls` file, save it as `.xlsx` in your spreadsheet program first. Click **Import From XLS** and choose a `.csv` or `.xlsx` file. KOSMA reads the first worksheet of the file and opens **Import Variables**.
If KOSMA cannot read the file, **Import Variables** says so above the columns.
For each field, choose the column that holds it. KOSMA pre-fills the fields by recognising common English and German column titles such as *Name*, *Amount* or *Betrag*. If it finds no matching title:
- **Name** gets the first column. - **Expression** gets the next column not yet mapped to a field. - **Comment** and **Unit** stay on **None**.
If the first row holds only text, KOSMA ticks **First row is a header** and does not import that row. The preview shows the first five rows that KOSMA imports.
| Field | Becomes | | -------------- | ------------------------------------------------------------------------------------- | | **Name** | the **Shorthand Name** you type in formulas | | **Expression** | the **Calculation Formula**: a number or a formula, used as is | | **Comment** | the **Comment** | | **Unit** | the **Unit**, if the budget already has a unit of that name; otherwise it stays empty |
**Name** and **Expression** must point to two different columns. While they point to the same one, **Import From XLS** in **Import Variables** is greyed out. If KOSMA picked the wrong column for a field, choose another one, or **None** for **Comment** and **Unit**.
KOSMA turns each cell of the **Name** column into a **Shorthand Name**: spaces and special characters become underscores, so "DOP St. 1" becomes `DOP_St_1`.
A run of such characters becomes one underscore. KOSMA also removes underscores at the start and end, puts an underscore in front of a name that is only digits, and adds `_2`, `_3` and so on to a name that already exists. KOSMA never overwrites an existing variable. A long description such as *Hotel, single room, category 3* becomes a long name that you then type in every formula. To keep the description, put it in its own column and map it to **Comment**. After the import, you can change a name under **Shorthand Name** in the **Variables** window.
Click **Import From XLS** in **Import Variables**. KOSMA adds the variables at the end of the selected group and calculates their formulas.
If the file has no data rows, or a row has an empty **Name** or **Expression** cell, KOSMA stops the import, imports none of the rows and shows an error with the row number (`KOSMA-E-1010`, `KOSMA-E-1011` or `KOSMA-E-1012`).
Fill in the empty cell and import the file again.
A group holds at most 200 variables, counting the ones already in it. If the file would take the group past 200, KOSMA imports nothing and shows an error (`KOSMA-E-4005`).
For example, a group with 150 variables takes a file of up to 50 rows. Split a longer file and import the rest into a second group.
Markdown