This object describes a measure selected in the slice.
{ uniqueName: string, active: boolean, aggregation: string, caption: string, formula: string, individual: boolean, calculateNaN: boolean, format: string, grandTotalCaption: string }
Property/Type | Description |
---|---|
uniqueName String | The measure’s unique name. |
active Boolean | optional Indicates whether the measure will be selected for the slice (true ) or not (false ). |
aggregation String | optional The name of the aggregation that will be applied to the measure. See the list of supported aggregation functions. If the measure is calculated, skip the aggregation property. |
String | optional The measure’s caption. |
formula String | optional Represents the formula. Must be specified when adding a calculated value. The formula can contain:
|
individual Boolean | optional Defines whether the formula is calculated using raw values (true ) or using aggregated values (false ).Can be used only for the calculated values. Only for "json" and "csv" data source types.Default value: false . |
calculateNaN Boolean | optional Defines whether the formula is calculated using NaN values (true ) or using null values (false ).Can be used only for the calculated values. Only for "json" and "csv" data source types.Default value: true . |
format String | optional The name of the number format that will be applied to the measure. A number format’s name must be defined in the report.formats array. |
String | optional The measure’s grand total caption. |
Example with the MeasureObject:
slice: {
measures: [
// A regular measure
{
uniqueName: "Price",
aggregation: "sum",
caption: "Price",
format: "price",
grandTotalCaption: "Total price",
},
// A calculated value
{
uniqueName: "average_quantity",
active: true,
caption: "Average Quantity",
formula: "sum('Quantity')/count('Quantity')",
individual: true,
calculateNaN: false,
format: "Average Quantity",
grandTotalCaption: "Average Quantity"
},
],
// Other slice properties
}