Documentation menu
getAllMeasures
getAllMeasures():Array
Returns a list of all available measures (both active and inactive) from the report.
Returns
Returns an array of objects. Each object is characterized by the following properties:
Name | Type | Description |
---|---|---|
aggregation | String | The measure’s aggregation name. |
availableAggregations | String [] | An array of available aggregations for the measure. |
availableAggregationsCaptions | String [] | An array of captions of available aggregations. |
calculated | Boolean | Returns true if the measure is calculated. |
caption | String | The measure’s caption. |
format | String | The number formatting rule name. |
formula | String | Represents a formula if the measure is calculated. |
grandTotalCaption | String | The measure’s grand total caption. |
individual | Boolean | Defines whether the formula is calculated using raw values (true ) or using aggregated values (false ). |
name | String | The measure’s name. |
originalCaption | String | The measure’s original caption. |
uniqueName | String | The measure’s unique name. |
Example
webdatarocks.getAllMeasures();
/* The method returns an array of objects:
[
{
aggregation: "sum",
availableAggregations:
["sum", "count", "distinctcount", "average", "product",
"min", "max", "percent", "percentofcolumn", "index",
"difference", "%difference", "stdevp",
"stdevs", "runningtotals"],
availableAggregationsCaptions:
["Sum", "Count", "Distinct Count", "Average", "Product",
"Min", "Max", "Percent", "Percent of Column", "Index",
"Difference", "% Difference", "Population StDev",
"Sample StDev", "Running Totals"],
caption: "Sum of Sales",
format: "currency",
grandTotalCaption: "Total Sum of Sales",
name: "Sales",
originalCaption: "Sales",
uniqueName: "Sales"
},
{
aggregation: "none",
availableAggregations: [ ],
availableAggregationsCaptions: [ ],
caption: "Revenue",
format: "",
formula: "SUM('Price') * SUM('Quantity')",
grandTotalCaption: "Total Revenue",
name: "Revenue",
originalCaption: "Revenue",
uniqueName: "Revenue"
}
]
*/
Try on CodePen.