We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.
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:

  • aggregation – String. The measure’s aggregation name.
  • availableAggregations – Array of strings. An array of available aggregations for the measure.
  • availableAggregationsCaptions – Array of strings. An array of captions of available aggregations.
  • calculated – Boolean. true if the measure is calculated.
  • caption – String. The measure’s caption.
  • folder – String.
  • format – String. The number formatting rule name.
  • formula – String. A formula if a measure is calculated.
  • grandTotalCaption – String. The measure’s grand total caption.
  • individual – Boolean.
  • name – String.
  • originalCaption – String.
  • 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.

See also