Skip to content

Instantly share code, notes, and snippets.

@erikdubbelboer
Created November 16, 2017 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikdubbelboer/07c88de309c356e6933f773e61f1cf31 to your computer and use it in GitHub Desktop.
Save erikdubbelboer/07c88de309c356e6933f773e61f1cf31 to your computer and use it in GitHub Desktop.
{
"aggregations": [
{
"fieldName": "metric_with_total_count_of_events",
"name": "total",
"type": "longSum"
},
{
"name": "rolledup",
"type": "count"
}
],
"dataSource": "your_datasource",
"dimensions": [
],
"granularity": "DAY",
"having": null,
"intervals": "2017-11-16:00:00+00:00/2017-11-17T00:00:00+00:00",
"queryType": "groupBy",
"postAggregations": [
{
"fields": [
{
"fields": [
{
"fieldName": "rolledup",
"type": "fieldAccess"
},
{
"fieldName": "total",
"type": "fieldAccess"
}
],
"fn": "/",
"type": "arithmetic"
},
{
"type": "constant",
"value": 100
}
],
"fn": "*",
"name": "rollup_perc",
"type": "arithmetic"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment