We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.
All documentation
  • API Reference for older versions
  • AggregatedDataObject

    This object is used in the responses to the /select requests for the pivot table and the flat table. It contains information about aggregated data.

    Properties

    {
      values: {
        (uniqueName): {
          (func): number
        }
      },
      keys: {
        (uniqueName): string | number
      }
    }
    Property/TypeDescription
    values
    Object
    For the /select request for the pivot table, values should contain numeric values that are calculated for a specific tuple.
    For the /select request for the flat table, values should contain numeric values that are calculated for column totals.
    values.(uniqueName)
    Object
    The field's unique name.
    values.(uniqueName).(func)
    Number
    The result of the calculation, where (func) is an aggregation function.
    keys
    Object
    optional Field's keys that describe a specific tuple. In case it is not defined, values are treated as totals.
    Only for the /select request for the pivot table.
    keys.(uniqueName)
    String | Number
    Field's member, where (uniqueName) is a field's unique name. Note: totals for each field should be included in the response even if they are disabled on the client side.

    Examples

    1) Example of a response to the /select request for the pivot table, where the AggregatedDataObject contains totals and values calculated for a specific tuple:

    {
      "aggs": [
        {
          "keys": {
            "City": "Toronto"
          },
          "values": {
            "Price": {
              "sum": 100
            }
          }
        },
        {
          "keys": {
            "City": "New York"
          },
          "values": {
            "Price": {
              "sum": 23
            }
          }
        },
        {
          "values": {
            "Price": {
              "sum": 123
            }
          }
        }
      ]
    }

    2) Example of a response to /select request for the flat table, where the AggregatedDataObject contains column totals:

    {
      "fields": [
        { "uniqueName": "Color" },
        { "uniqueName": "Destination" },
        { "uniqueName": "Country" },
        { "uniqueName": "Price" }
      ],
      "hits": [
        ["red", "Germany", "United States", 185],
        ["red", "Germany", "United States", 374],
        ["red", "Germany", "United States", 123]
      ],
      "aggs": [
        {
          "values": {
            "Price": {
              "sum": 682
            }
          }
        }
      ],
      "page": 0,
      "pageTotal": 1
    }

    See also

    /select request for the pivot table
    /select request for the flat table