The syntax for writing rules in Cubix is quite straightforward and many models need little more than the basic numeric operators in their rules. However, more complex calculations can be achieved using for example conditional clauses, lookup references and relative dimension members.
Simple Rule Syntax
Syntax | Description |
---|---|
* | Multiply by |
/ | Divide by |
+ | Add |
– | Subtract |
.. | Sum through. This function sums all items in the member list found between and including the items mentioned in the rule. |
Cell Specs
As well as specifying the range a rule will be applied to, the function of a rule can be narrowed using Cell Specs. Cell Specs are similar to ranges, but they are entered as part of the rule itself and therefore are more related to what is being applied, rather than where it is being applied.
In their simplest form, Cell Specs are a list of dimension members, separated by a colon : For example
Sales:Jan:Input or Budget:LocalCurrency
Some Examples of Cell Specs
Jan | This simply returns the January Time period value for the current variable, view, entity, version, and product. |
Sales or :Sales | The colon preceding Sales is used to separate one dimension member from another. |
Sales:Jan | This will get the January Sales value for the current entity, version, and product, regardless of the current time period and regardless of the variable. |
Sales:Time:Jan | This is the same as above, except the dimension is specified for Jan. This will be essential when two dimensions have members with the same name. |
Budget:LocalCurrency:Sales:HalfYr:Net:YTD | The Cell Specs can be made as specific as required to narrow down the range to be calculated. |
Post your comment on this topic.