Budgeting
You can total what one company or one tag carries in a budget formula, and you know why a budget has no such total by effect.
`SUM_COMPANY` and `SUM_TAG` total a part of the budget in a formula: everything a company carries, or every row that carries a tag.
You can type them in a budget cell under **Quantity**, **Price/Unit** or **X**, in the **Base** of a markup and in the **Calculation Formula** of a variable. The fields of extra costs, wage supplements and fringes do not offer them. For how to pick a function in the formula menu, see [write a formula](/kb/article/write-a-formula).
`SUM_COMPANY` totals what a company carries in the budget. For each row assigned to the company, it counts the row's total times the company's percentage. For how to assign a company and its share to an account, see [split costs between companies](/kb/article/split-costs-between-companies).
A share can be a percentage or a fixed amount. For a share entered as a fixed amount, `SUM_COMPANY` counts the row's whole total, not the amount you typed.
Use this function for a coproduction handling fee. Give each partner a markup of their own. As its **Base**, enter `SUM_COMPANY` with the partner's name, and as its percentage, the rate of the partner's deal. When a partner's share on an account changes, KOSMA recalculates that partner's markup. In the demo project, the budget Demo Feature has one such markup for each partner: 7 % of `SUM_COMPANY("Northlight")` and 7 % of `SUM_COMPANY("Edelweiss")`. For how to create a markup, see [add and edit markups](/kb/article/add-and-edit-markups).
`COUNT_COMPANY("Company name")` counts the rows assigned to the company instead of adding up their totals. It counts subaccounts and accounts that have no subaccounts. Use it for a charge per budget line.
`SUM_TAG` totals every row that carries the tag, wherever the row sits in the category tree. Use it to total costs that have no place of their own in the budget's categories, such as VFX costs spread over camera, post-production and crew. `COUNT_TAG("VFX")` counts those rows instead of adding up their totals. For how to tag an account, see [use tags on accounts](/kb/article/use-tags-on-accounts).
In the demo project, the budget How KOSMA Calculates has the markup Cast levy: 2 % of `SUM_TAG("Cast")`. The rows tagged Cast total 1,000, so the markup comes to 20.
If you tag a parent account and its subaccounts, or assign them the same company, the total counts them once. An account with subaccounts counts only through its subaccounts.
In a budget, all four functions leave markups out. They count markups only in an **Info** value on the dashboard.
A formula never counts the row it stands in. If a tagged account uses `SUM_TAG` with its own tag, its own total stays out of the result.
Both functions need the exact name of an existing company or tag, in quotes. Pick the name from the dropdown in the formula menu, so the spelling is right. KOSMA never reads a wrong name as zero. If the name is misspelled or does not exist, KOSMA still saves the formula, then frames the field in red and shows this message:
Unknown part of expression
If you rename a company or a tag, KOSMA changes the name in every formula that uses it. The results stay the same.
If you delete a company that a formula names, KOSMA first lists those formulas under this message:
Are you sure you want to remove company Northlight? Deleting it will leave the formulas below pointing at a missing element. You can delete anyway and fix them later.
For a tag, the message says tag instead of company. To delete it, click **Delete anyway**. The formulas lose their result, so the field is empty, and they show the same red frame and message as a misspelled name.
A budget has no effect version of `SUM_COMPANY` or `SUM_TAG`. `SUM_EFFECT` exists only in the **Amount** field of a financing plan and in an **Info** value on the dashboard. There it totals the financing sources that carry the effect, not a part of the budget.
In a budget, you see an effect total in a column, on a printout or on the dashboard. See [show company and effect columns](/kb/article/show-company-and-effect-columns). To make a calculation follow the accounts an effect marks, give those accounts a tag as well and use `SUM_TAG`.
Deleting an effect also opens a message with **Delete anyway**. No budget formula can name an effect, so the list under the message shows only the budget rows that carry the effect.
With a Free licence, in a budget shared with you read-only, in a budget linked to a cost control set and when you work signed out, you can read every formula but not change it. KOSMA greys out the fields. As a guest, you can write formulas only in a budget shared with you for editing, and only if your licence covers Budgeting. In the demo project, you can edit formulas with every licence. For details, see [what your licence includes](/kb/article/what-your-licence-includes).
Markdown