If you want to reuse a calculation, it may be a good idea to put some flexibility into your calculation, so that e.g. the choice of which value should be used as index 100 can be changed easily, from the smartpad instead of having to edit the formula manually. To tell the SmartCalculations editor that there is such a customizable reference in the formula, you must supply the metadata (name, default value etc.) for the ranges in question.
The metadata for a range are given in square brackets after the range, just as range filters are given in parenthesis.
Metadata element |
Syntax example |
Description |
Parameter name |
d1 ["A"] |
Name, identifies the parameter. Must always be present. All ranges with the same name are synchronized. |
Allow range |
d1 ["A":range] |
Allow the user to select both starting and ending point. |
Editable filters |
d1 ["A":filter(v,h,o)] |
Allow the user to edit the given filter types. Filters: v = visibility, h = hierarcy, o = order. If the parenthesis are missing, all filters can be edited. |
Default value |
d1 ["A"=0] |
When a template is used to add a new calculation, the default reference can be specified here. If a relative reference is given, like it is in this example, it is modified unless the calculation is added ‘for all dimension values’, i.e. as a custom measure. If it is greater than zero, it is modified to a left-to-right data reference, e.g. 2 => d2. If it is less than or equal to zero, it is modified to a right-to-left data reference, e.g. 0 => d-1 and -1 => d-2. In this way, if the template is designed as a custom measure, it can reasonably easily be added as calculated columns and rows too. |
Description |
d1 ["A","Source data"] |
Short explanation to be shown in the list of parameters and on the edit page of this parameter. |
d1(v) ["Base":filter=d1,"Index 100"] |
|
The metadata for measures are like the metadata for ranges, except the ‘:range’ and ‘:filter’ elements are not available.
Comments
Please sign in to leave a comment.