What is a Compute a number dimension ?
This kind of dimension enriches your card with data, like any other dimension. But the value on a card is not chosen manually in the card edition dialog, but is the result of a computation involving values provided by other dimensions on your card.
Example
Let's say that you have a number dimension called Budget, and you'd like to compute Budget with tax. The formula might be the following (for 21% of VAT):

Where are raw numbers coming from?
There are two sources of raw numbers to be used in larger expressions:
-
Track any numberdimensions provide a direct number encoded on cards themselves
-
Dimensions with numbers attached to values. First you need to enable the option on the dimension itself and save it (CTRL-S):

Then you can associate numbers to values:

The expression language
The expression language uses Elo, that can be used to compute any number you'd like. In those expressions:
_denotes the current card, on which the computed value applies,_.xxxdenotes the card value along the dimension whose name isxxx(insnake_caseformat ; if your dimension is namedTime spent, the variable istime_spent)_.xxx.iddenotes the identifier of the value, for dimensions with a list of values set on cards (simply use_.xxxfor numbers, dates and free text)_.xxx.semanticsdenotes the semantics value, for dimensions with numbers associated to values (second case of the earlier section)
How to find the dimension codes ?
In the formula editor, pressing _. should provide you with a suggestion showing the list of dimensions :

For a particular dimension, you'll find the code to use in formulas in the General panel when editing it :

How to write logic according to the dimension values of other dimensions ?
Let's say that you want to write some complex logic for your tax percentage according to the type of product, tracked in another dimension :

The identifiers of the dimension values you can reference in such a formula can be found in the Values panel of the dimension details :

Where to get help ?
Writing formulas is always a bit difficult for non-tech. Jump on our Klarocardistas community to get immediate help.
Going further
- Starting with Klaro Cards 0.259.0, Klaro Cards uses Elo which is simple, clean and powerful. The documentation online is certainly worth a read.
- For business instances on earlier versions, Klaro Cards still uses the Livescript language.