What's new Download Reportworq
⬇ Guide PDF

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#

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]")

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 page

Or write to support@reportworq.com directly.