Single aggregation
Creates pivottable with total line
Input
{
"data": [
{
"name": "Alice",
"score": 1,
"highest": 10
},
{
"name": "Bob",
"score": 2,
"highest": 20
},
{
"name": "Alice",
"score": 4,
"highest": 40
},
{
"name": "Charlie",
"score": 8,
"highest": 80
},
{
"name": "Bob",
"score": 16,
"highest": 160
}
],
"index": "name",
"aggregateFunctions": [
{
"field": "score",
"aggregators": [
"sum"
]
}
]
}Output · HTTP 200
{
"result": [
{
"Name": "Alice",
"Sum of score": 5
},
{
"Name": "Bob",
"Sum of score": 18
},
{
"Name": "Charlie",
"Sum of score": 8
},
{
"Name": "Grand Total",
"Sum of score": 31
}
]
}Show curl command
curl -X POST 'https://api.1001fx.com/spreadsheet/pivottable' \
-H 'X-API-KEY: YOURSECRETAPIKEY' \
-H 'Content-Type: application/json' \
-d '{"data":[{"name":"Alice","score":1,"highest":10},{"name":"Bob","score":2,"highest":20},{"name":"Alice","score":4,"highest":40},{"name":"Charlie","score":8,"highest":80},{"name":"Bob","score":16,"highest":160}],"index":"name","aggregateFunctions":[{"field":"score","aggregators":["sum"]}]}'