Search code examples
webdatarocks

How to specify multiple measures with different aggregation function?


I want to display min, max and average of the same data field. Tried the designer on demo page and it is not possible to add same column into Values list, nor is it possible to check multiple aggregation functions in the dropdown.

I tried to edit report JSON manually, but this doesn't seam to be supported:

       "measures": [
            {
                "uniqueName": "myvalue",
                "aggregation": "min"
            },
            {
                "uniqueName": "myvalue",
                "aggregation": "max"
            },

Solution

  • You can add multiple aggregations with the calculated values option, e.x.

    "measures":[
    {
    "uniqueName": "Min myValue",
    "formula": "min('myValue')",
    },
    {
    "uniqueName": "Max myValue",
    "formula": "max('myValue')",
    }
    

    Also, you can find the "Add calculated value" button on the top of the Fields List window. It allows creating calculated values in runtime using UI tools.

    You can find more examples with calculated values here