Template Metadata

If you want to reuse a calculation, it may be a good idea to put some flexibility into your calculation, so that the choice of which value should be used as an index (e.g., index 100) can be easily changed by using the Smartpad instead of having to edit the formula manually. 

To tell the Smart Calculations 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

Metadata Element 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 = hierarchy,
           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 when the template is designed as a custom measure, it can be reasonably easy to add as calculated columns and rows.

Description

d1 ["A","Source data"]
d1(v) Base":filter=d1,"Index 100"]

Short explanation to be shown in the list of parameters and on the edit page of this parameter.

 

The metadata for measures are like the metadata for ranges, except the ‘:range’ and ‘:filter’ elements are not available.