/
Tabulations

Tabulations

Overview

The tabulate method in Rich Data Services is available for users to create tabulations and aggregations of their data.

Supported Functions

The tabulate method supports the following functions for the measures.

ABSAVGCOUNTMAXMINSQRTSTDDEV_POPSUMVAR_POP

Creating Tabulations

  • To create a tabulation we will need to specify our dimensions (the topics of interest) and measures (quantities being counted). The most basic tabulation would just be a count of the values for the dimension. We can do this by specifying the variables we want to use as dimensions with the dims parameter.

    Basic Tabulation
    http://{host}/rds/api/catalog/test/view/tabulate?dims=var


    Tabulation Output
     {
        "records": [
            [
                1,
                182
            ],
            [
                2,
                354
            ],
            [
                3,
                126
            ]
        ],
        "info": {
            "colCount": 2,
            "format": "MTNA",
            "includeMetadata": false,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }


  • To add a measure, add the measure parameter with a computed variable.

    Basic Tabulation
    http://{host}/rds/api/catalog/test/view/tabulate?dims=var&measure=average:AVG(var2)


    Average Output
    {
        "records": [
            [
                1,
                3.1154
            ],
            [
                2,
                3.0932
            ],
            [
                3,
                2.9365
            ]
        ],
        "info": {
            "colCount": 2,
            "format": "MTNA",
            "includeMetadata": false,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }


  • Multiple dimensions and measures can be added by using a comma separated list of variables for each

    Multiple Dimensions and Measures
    http://{host}/rds/api/catalog/test/view/tabulate?dims=var1,var2&measure=avg:AVG(var3),avg2:AVG(var4)


Related content