Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • In this example we will create a tabulation and retrieve it along with its metadata. We will assume that we have a collection named "test" and a view named "view" with a variable named "var" that has the values 1, 2, and 3. In this example we will run a tabulation that will count the frequencies of each of these values that could be used to create a chart.
  • Running the tabulation would normally look something like this:

    Code Block
    titleTabulation
    http://{host}/rds/test/view/tabulate?dims=var&metadata
    Code Block
    titleTabulation Output
     {
        "metadata": {
            "variables": {
                "resources": [
                    {
                        "id": "var",
                        "name": "My numeric variable",Variable",
                        "index": 5,
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC",
                        "width": 1
                    },
                    {
                        "id": "count",
                        "name": "count",
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC"
                    }
                ],
                "info": {
                    "offset": 0,
                    "more": false,
                    "count": 2
                }
            }
        },
        "records": [
            [
                1,
                182
            ],
            [
                2,
                354
            ],
            [
                3,
                126
            ]
        ],
        "info": {
            "colCount": 2,
            "format": "MTNA",
            "includeMetadata": true,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }
  • If there is a classification for the variable, the classification with its code and categories will also be returned. 

    Code Block
    titleTabulation With Classification
     {
        "metadata": {
            "variables": {
                "resources": [
                    {
                        "id": "var",
                        "name": "Variable",
                        "index": 5,
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC",
                        "width": 1,
                        "classification": "varClassification"
                    },
                    {
                        "id": "count",
                        "name": "count",
                        "storageType": "NUMERIC",
                        "displayType": "NUMERIC"
                    }
                ],
                "info": {
                    "offset": 0,
                    "more": false,
                    "count": 2
                }
            },
            "classifications": {
                "resources": [
                    {
                        "id": "varClassification",
                        "codes": {
                            "resources": [
                                {
                                    "value": "1",
                                    "label": "METROPOLITAN AREA"
                                },
                                {
                                    "value": "2",
                                    "label": "TOWN OR CITY"
                                },
                                {
                                    "value": "3",
                                    "label": "OPEN COUNTRY"
                                }
                            ],
                            "info": {
                                "codeLimit": 100,
                                "codeOffset": 0,
                                "count": 3,
                                "moreCodes": false
                            }
                        }
                    }
                ],
                "info": {
                    "limit": 100,
                    "offset": 0,
                    "codeLimit": 100,
                    "codeOffset": 0,
                    "more": false,
                    "count": 1
                }
            }
        },
        "records": [
            [
                1,
                182
            ],
            [
                2,
                354
            ],
            [
                3,
                126
            ]
        ],
        "info": {
            "colCount": 2,
            "format": "MTNA",
            "includeMetadata": true,
            "limit": 20,
            "offset": 0,
            "moreRows": false
        }
    }