Cost Control
You know whether an import that overlaps an earlier one duplicates your cost items, and how to replace a corrected booking.
When an accounting export overlaps a period you already imported, KOSMA does not import a line again if the set already holds it unchanged. In step 4 of the import, **Matching**, KOSMA compares each line of the file with the cost items in the set. To change the set, you need a Cost Control or Production licence, or a running trial. As a guest, the set must also be shared with you for editing. See [what your licence includes](/kb/article/what-your-licence-includes).
To keep the set as it is now, copy it first with  **Copy Cost Control** next to the set dropdown; see [copy a cost control set](/kb/article/copy-a-cost-control-set). In step 3 of the import, **Options**, you can also tick **Back up this set first** to let KOSMA make this copy; see [import accounting data](/kb/article/import-accounting-data). If a re-import went wrong, **Edit** > **Undo** in the same session undoes the whole import in one step.
The **Matching** step shows this text:
KOSMA automatically matches data with the same reference, text, amount and payment date. This data is not imported again. Drag new data on existing cost items to replace them.
KOSMA compares a line only with the cost items on the account that the line's account number belongs to. The entry date does not count. Each cost item matches one line at most. If the file contains the same line twice and the set holds it once, one row is **Matched** and the other is **New**.
Each row in **Matching** has one of four states. Within an account, KOSMA lists them in this order:
| State | Meaning | | ------------ | ----------------------------------------------------------------------------------------- | | **Matched** | The line equals a cost item in the set. KOSMA does not import it again. | | **Replaced** | You dragged a new line onto a cost item. On import, KOSMA updates that cost item with it. | | **Existing** | A cost item in the set that no line matches. KOSMA leaves it as it is. | | **New** | A line that matches no cost item. KOSMA adds it as a new cost item. |
KOSMA hides the **Matched** rows. To see them, tick **Show automatically matched data**.
A corrected line matches no cost item, because one of the values KOSMA compares (reference, text, amount, payment date) changed: a new amount, a moved payment date or a retyped reference is enough. The line arrives as **New**, and the original cost item stays **Existing**. If you import the line like this, the set contains both cost items.
To replace the original, drag the **New** row by its grip  onto the **Existing** row. The dragged row changes to **Replaced**. If you dropped it on the wrong row, click  **Undo replacement** in the **Replaced** row. KOSMA changes the set only when you click **Import**. The replaced cost item keeps its tags, effects, company and attachments. It does not get the tag from **Add Tag To Imported Data**, so a filter by that tag finds only the new cost items of the import.
In these cases, KOSMA cannot match a line to the cost item from the earlier import, and the line arrives as **New** again:
- The line has no account number. It goes to  **Unmapped**, on a new **Unmapped** account; see [import accounting data](/kb/article/import-accounting-data). - You moved the cost item to another account after the earlier import. - You changed the cost item's description, reference, paid amount or payment date in KOSMA. - You entered the cost item by hand, with an expected amount and no paid amount.
To give lines without an account number their account, see [match accounts, effects and companies](/kb/article/match-accounts-effects-and-companies).
Markdown