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**.
The file dialog also offers `.xls` files, but KOSMA cannot read them. **Import Variables** then stays empty.
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**, as the dialog explains:
The Name column becomes each variable's shorthand used in formulas; spaces and special characters become underscores (e.g. "DOP St. 1" → "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 one of these messages:
“{file name}” has no data rows to import.
Row {number}: the mapped Name cell is empty.
Row {number}: the mapped Expression cell is empty.
Fill in the empty cell and import the file again.
If the file has more than 200 rows, KOSMA imports only the first 200 and shows this message:
A variables group cannot contain more than 200 variables. Not all data was imported.
The limit applies to each file, even though the message mentions a group. Put the remaining rows into a second file and import it into a second group.
Markdown