DefineCalc function#
DefineCalc declares an MDX WITH MEMBER rollup expression - a user-defined calculated member - that other retrieval formulas can reference. Use it for custom calculated members inside a Universal Report.
DefineCalc is a native TM1 / Planning Analytics function. The name is matched without regard to case, so DEFINECALC resolves to the same function.
Signature#
=DefineCalc(datasource, server, calcMun, [expression], [outputMun], [disableScramble])
Arguments#
| # | Argument | Type | Required | Permitted values and notes |
|---|---|---|---|---|
| 1 | datasource |
String | Yes | The data source. "*" means any data source. |
| 2 | server |
String | Yes | The server instance. "*" means any server instance. |
| 3 | calcMun |
String | Yes | The member unique name to assign, for example [Measure].[Gross Margin]. |
| 4 | expression |
String | No | The MDX that defines the calculated member. |
| 5 | outputMun |
Boolean | No | TRUE returns the full member unique name; FALSE (default) returns just the member name. |
| 6 | disableScramble |
Boolean | No | FALSE (default) generates a unique internal member name to avoid collisions; TRUE uses the member unique name as written. |
DefineCalc takes three to six arguments.
Support notes#
- Universal Reports. As documented on the prior IBM Planning Analytics functions page,
DefineCalcis supported in full (dynamic) Universal Reports and not in static Universal Reports. This scope is carried from that documentation and still needs confirmation against the current build; treat it as a documented limitation rather than a guarantee.
What happens when an argument is wrong#
| Situation | Result |
|---|---|
| Fewer than three arguments | Hard error - too few parameters |
| More than six arguments | Hard error - too many parameters |
Blank datasource, server, or calcMun |
Hard error |
calcMun is not a valid member unique name |
Warning, the cell returns blank |
Examples#
=DefineCalc("*", "*", "[Measure].[Gross Margin]", "[Measure].[Revenue] - [Measure].[Cost]")
Related pages#
- IBM Planning Analytics functions - the function index and the shared error model.
- TM1VAL function - hierarchy-aware retrieval.
Feedback on this page
Comments, questions, requests, or something missing or unclear? Email us - the page you are on is filled in for you.
Email feedback on this pageOr write to support@reportworq.com directly.