Financing
You can size a balancing source from the plan's other sources, totalled by tag or status, and you know why such a total is empty or 0.
A balancing source, such as gap financing, covers what the other sources leave open. Four functions in a source's **Amount** total the sources of the same plan. To change an **Amount**, you need a licence that lets you edit Financing ([what your licence includes](/kb/article/what-your-licence-includes)). For the functions that take their figures from the linked budget, see [reference the budget in a source amount](/kb/article/reference-the-budget-in-a-source-amount).
Double-click the **Amount** cell of the balancing source, or select it and press Enter. While you type, KOSMA shows a list of suggestions.
Type the function's name, or open  **Functions** in the list of suggestions. Click a `FINANCING_` function to insert it. When you point at `SUM_TAG_F`, a list of the plan's tags opens. Click a tag, and KOSMA inserts the whole call with the tag in quotes.
| Function | Totals the Amount of the plan's sources that … | | ----------------------- | ---------------------------------------------- | | `SUM_TAG_F("…")` | carry the tag you name | | `FINANCING_CONFIRMED()` | have the status **Confirmed** | | `FINANCING_SUBMITTED()` | have the status **Submitted** | | `FINANCING_PENDING()` | have the status **Pending** |
If you type the call yourself, type the tag in quotes exactly as the plan has it. Mind the `_F`: `SUM_TAG` and `SUM_COMPANY` without it total costs in the budget, not sources in the plan. You cannot yet total sources by company or effect, so the list does not offer `SUM_COMPANY_F` or `SUM_EFFECT`. Older formulas that use them stay as they are but return nothing, because a plan has no companies or effects of its own.
Complete the formula, then leave the cell. **Total** shows the result. For example, gap financing covers the budget's grand total (`GT`) less the confirmed and submitted money:
Another formula subtracts every source with the tag soft money:
If the balancing source itself has the company, tag, effect or status that its formula totals, it counts itself. In the first example, its status is **Pending**. The formula totals only **Confirmed** and **Submitted**, so the source does not count itself.
Each function adds up the **Amount** of the matching sources, converted into the plan's default currency. This is the figure in each source's **Total** column. Installments do not count. Only `SUM_TAG_F` counts deactivated sources. The three `FINANCING_` functions leave them out, as do the status totals next to the grid ([deactivate sources, groups and countries](/kb/article/deactivate-financing-rows)).
A source has one company and one effect, but often several tags. It then counts towards each of its tags. `SUM_TAG_F` uses the tags you give sources in **Tags**, not the tags of the budget. For details, see [assign a company to a source](/kb/article/assign-a-company-to-a-source), [assign an effect to a source](/kb/article/assign-an-effect-to-a-source) and [tag, note and attach files to a source](/kb/article/tag-note-and-attach-files-to-a-source).
There are two possible causes. First, the formula names a tag the plan does not have, often because of a typo. KOSMA does not mark such a tag as **Invalid** and saves the formula. Correct the tag to match the plan exactly. Second, a matching source has an empty **Amount**. Give that source an **Amount**.
If a part outside the quotes is unknown, such as a misspelled function name, the cell shows **Invalid** while you type. Point at **Invalid** to see the unknown part:
Unknown part of expression: {names}
**If a function adds up to 0.** `SUM_TAG_F` gives 0 if the tag is in the plan's list of tags but no source has it. If the tag is missing from that list, the result stays empty.
Markdown