ojg
ojg copied to clipboard
Aggregates
Hey! Are you able to calculate aggregates with ojg? If so, could you please provide an example of an average of a field (using the command-line tool if possible)? Thanks!
There are no tools for performing an average over collected values without writing code. The code would be pretty simple but it would require a loop that does the summation.
An analytics package for OjG might be a nice addition though. Maybe with functions for average, max, min, unique, sum, and more. If you are interested in that and would like to see it added to OjG how about starting a discussion and we can starting putting together the functions for the package.
Here they support functions: https://github.com/json-path/JsonPath
I might use a different syntax than those function extensions to JSONPath but implementing something similar seems like a nice addition..
I added a discussion for this at #89. Lets use that for continuing the discussion.
This is really out of scope for the package and would be better implemented as a separate package.