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.
You import a rate card or price list from a spreadsheet into a group of variables, so you do not have to type 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, and KOSMA syncs the new variables when 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 of your file that holds it. KOSMA fills in the fields in advance: it recognises common English and German column titles such as *Name*, *Amount* or *Betrag*. If it recognises no title for **Name**, it takes the first column; if none for **Expression**, the next free column. **Comment** and **Unit** without a recognised title stay on **None**. If the first row holds only text, KOSMA also ticks **First row is a header**, and then 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, taken over as written | | **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. Until they do, **Import From XLS** 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").
KOSMA also removes underscores at the start and end of a name, puts an underscore in front of a name that is only a number, 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 long description, put it in another column and map that column 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.
The second and third message name the row whose **Name** or **Expression** cell is empty. Fill in the cell in your file and import the file again.
One file imports at most 200 variables. If it has more rows, KOSMA imports the first 200, keeps them and shows this message:
A variables group cannot contain more than 200 variables. Not all data was imported.
Put the remaining rows into a second file and import it into a second group.
Markdown