CalculatedMeasure.expression
Property Description |
The expression for the calculated measure. |
Type |
|
Module |
|
Parent Object |
|
Sibling Object Members |
|
Since |
2021.2 |
Errors
Error Code |
Thrown If |
---|---|
|
The expression is already defined. |
|
The value specified for this property is not a workbook.Expression object. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/workbook Module Script Samples. Also see Full scripts in the Tutorial: Creating a Workbook Using the Workbook API topic.
// Add additional code
...
var myCalculatedMeasure = workbook.createCalculatedMeasure({
label: 'Balance',
expression: workbook.createExpression({
functionId: workbook.ExpressionType.MINUS,
parameters: {
operand1: workbook.createExpression({
functionId: workbook.ExpressionType.MEASURE_VALUE,
parameters: {
measure: myFirstDataMeasure
}
}),
operand2: workbook.createExpression({
functionId: workbook.ExpressionType.MEASURE_VALUE,
parameters: {
measure: mySecondDataMeasure
}
})
}
})
});
var theExpression = myCalculatedMeasure.expression;
...
// Add additional code