Is it possible to sort a query by a metric or dimension, over timestamp? Or does a groupBy query just always sort by timestamp first?
I am running the following query on my data:
{
"queryType": "groupBy",
"dataSource": "reporting",
"granularity": {"type": "period", "period": "P1W", "origin": "2015-12-27"},
"limitSpec": {"type":"default","limit":1000,"columns":[
{"dimension": "revenue", "direction": "ASCENDING"}
]},
"dimensions": ["hotel_id", "placement"],
"aggregations": [
{"type": "count", "name": "count"},
{ "type": "doubleSum", "name": "billing_cost", "fieldName": "billing_cost" },
{ "type": "doubleSum", "name": "transactions", "fieldName": "transactions" },
{ "type": "doubleSum", "name": "revenue", "fieldName": "revenue" }
],
"intervals": [ "2016-01-01T00:00:00.000/2016-03-01T00:00:00.000" ],
"having": {
"type": "and",
"havingSpecs": [{
"type": "greaterThan",
"aggregation": "billing_cost",
"value": 0
}]
}
}
I can use `granularity: all` to just sort by my given metric in some cases, but it would be nice to get the top performing weeks/days/months over a set of dimensions.