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 assigned to a company, or every row that carries a tag.
You can type them in a budget cell in the **Quantity**, **Price/Unit** or **X** column, 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 the share of the budget that is assigned to a company. For each row assigned to the company, it takes the row's total multiplied by 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).
If you type a share as an amount, KOSMA saves it as a percentage of the row's total. `SUM_COMPANY` treats it like any other share. If the row's total changes later, the company's amount changes with it.
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. An account with subaccounts does not count itself. Each of its subaccounts counts instead. Use it for a cost that applies 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.
For an account with subaccounts, only the subaccounts count. A tag or company on that account applies to all of its subaccounts. For example, an account with subaccounts A (300) and B (200) carries the tag VFX. `SUM_TAG("VFX")` returns 500.
A deactivated account does not count in any of the four functions, and neither do the accounts of a deactivated group or the subaccounts of a deactivated account.
In a budget, all four functions leave markups out. Only in the **Info** value on the dashboard do they also count markups, and only those that are not deactivated.
A formula never counts its own row. If a tagged account uses `SUM_TAG` with its own tag, its own total stays out of the result.
All four 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. If the name is misspelled or does not exist, KOSMA still saves the formula, but the formula has no result: the field stays empty and does not show 0. KOSMA 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. If you delete it anyway, the formulas lose their result, so the field is empty, and they show the same red frame and message as a misspelled name. To delete it, click **Delete anyway**.
An effect marks the accounts that count toward a funding condition. Budget formulas have no function that totals by effect, the way `SUM_COMPANY` and `SUM_TAG` do. `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 assigned to the effect, not budget accounts.
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 calculate with the accounts that have an effect, give those accounts a tag as well and use `SUM_TAG`.
In these cases, you can read every formula but not change it, and KOSMA greys out the fields:
- You have a Free licence. - The budget is shared with you read-only. - The budget is linked to a cost control set. - You are signed out.
As a guest, you need two things: the budget must be shared with you for editing, and your own licence must cover Budgeting. The demo project is the exception: there, any licence can edit formulas. For details, see [what your licence includes](/kb/article/what-your-licence-includes).
Markdown