I have been playing around with Keen and couldn't find a way to get multiple metrics in a single query. Although I don't mind to query again and merge the results in my app.
I also understand metrics api is simply designed to make visualisations easier where a analysis on a single property make sense.
Just want to know if it's possible in near future ?
It is possible to retrieve multiple metrics in a single query in certain situations.
You can use the Multi-Analysis query type to run multiple types of analyses over the same collection. Multi-Analysis is outlined in greater detail here: https://keen.io/docs/data-analysis/multi-analysis/
Retrieving multiple metrics from separate collections is a bit different. keen-js allows you to pass an array of queries to the
.run()
function which it then runs simultaneously in the background. While it's true that keen-js is still running multiple queries behind the scenes, passing an array of query objects mimics a single query operation.keen-js Example:
There's also an example in keen-js that shows how to combine the results of multiple queries into a single chart: https://github.com/keen/keen-js/blob/master/docs/visualization.md#combine-results-of-two-queries