Skip to content
Developerhome
Sage Distribution and Manufacturing Operations

Aggregate queries

  Less than to read

It is possible to create aggregate queries grouped on custom fields values.

The following table displays an example of an aggregated query created for a custom field. Some of the fields displayed are not mandatory and others have been omitted.

{ 
  xtremMasterData { 
    item { 
      queryAggregate { 
        edges { 
          node { 
            group { 
              marketingDate: _customData(selector: "marketingDate") 
            } 
            values { 
              basePrice { 
                sum 
                min 
                max 
              } 
            } 
          } 
        } 
      } 
    } 
  }
} 
{ 
  "data": { 
    "xtremMasterData": { 
      "item": { 
        "queryAggregate": { 
          "edges": [ 
            { 
              "node": { 
                "group": { 
                  "marketingDate": null 
                }, 
                "values": { 
                  "basePrice": { 
                    "sum": "773.32", 
                    "min": "0", 
                    "max": "70" 
                  } 
                } 
              } 
            }, 
            { 
              "node": { 
                "group": { 
                  "marketingDate": "\"2023-08-17\"" 
                }, 
                "values": { 
                  "basePrice": { 
                    "sum": "40", 
                    "min": "40", 
                    "max": "40" 
                  } 
                } 
              } 
            } 
          ] 
        } 
      } 
    } 
  }, 
  "extensions": { 
    "diagnoses": [] 
  }
}