☝️Small business or a startup? See if you qualify for our special offer.
+
All documentation

ValueObject

This object is used in the /select request for the pivot table and the /select request for the flat table. It provides information about a measure and an aggregation function that should be applied to this measure.

Properties

{
  field: FieldObject,
  func: string
}
Property/TypeDescription
field
FieldObject
The field selected as a measure.
func
String
The aggregation function name. For each field, the list of supported aggregations is defined in the response to the /fields request. Supported values may include: "sum", "count", "distinctcount", "average", "median", "product", "min", "max", "stdevp", "stdevs", "none", or a custom aggregation.
Note: for the fields of the "number" type, Flexmonster Pivot supports built-in front-end aggregations.

Examples

1) Example of the /select request for the pivot table with the ValueObject:

{
  "index": "data-set-123",
  "type": "select",
  "query": {
    "aggs": {
      "values": [
        {
          "func": "sum",
          "field": {
            "uniqueName": "price"
          }
        }
      ]
    }
  },
  "page": 0
}

2) Example of the /select request for the flat table with the ValueObejct:

{
  "index": "data-set-123",
  "type": "select",
  "query": {
    "fields": [
      {
        "uniqueName": "country"
      },
      {
        "uniqueName": "price"
      },
      {
        "uniqueName": "quantity"
      }
    ],
    "aggs": {
      "values": [
        {
          "func": "sum", 
          "field": {
            "uniqueName": "price"
          }
        },
        {
          "func": "sum", 
          "field": {
            "uniqueName": "quantity"
          }
        }
      ]
    }
  },
  "page": 0
}

See also

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