Aggregation and percentage

Hi,
Using the wikipedia sample data, I have the following query:

{
“queryType”: “groupBy”,
“dataSource”: “wikipedia”,
“granularity”: “day”,
“dimensions”: [“cityName”,“countryIsoCode”
],
“intervals”: “2016-06-27T00:00:00.000Z/2016-06-27T23:59:59.000Z”,
“filter”: {
“type”: “selector”,
“dimension”: “countryIsoCode”,
“value”: “FR”
},
“aggregations”: [
{
“type”: “count”,
“name”: “total”
}
]
}

It returns for a given day, the number of entries for a city (for cities in France). What I would like to have is the percentage of entries as well. This is obtained by dividing the total (from the aggregation) by total of all entries. That total is the result of:

{
“queryType”: “groupBy”,
“dataSource”: “wikipedia”,
“granularity”: “day”,
“dimensions”: [“countryIsoCode”
],
“intervals”: “2016-06-27T00:00:00.000Z/2016-06-27T23:59:59.000Z”,
“filter”: {
“type”: “selector”,
“dimension”: “countryIsoCode”,
“value”: “FR”
},
“aggregations”: [
{
“type”: “count”,
“name”: “total”
}
]
}

Can this be achieved?
Thanks - Christian

Hmmmmmm… I think because you need to SUM the results first, and then divide, you will need to use a subquery?