ojg icon indicating copy to clipboard operation
ojg copied to clipboard

Aggregates

Open dcmoura opened this issue 2 years ago • 4 comments

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!

dcmoura avatar Apr 19 '22 11:04 dcmoura

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.

ohler55 avatar Apr 19 '22 11:04 ohler55

Here they support functions: https://github.com/json-path/JsonPath

dcmoura avatar Apr 20 '22 09:04 dcmoura

I might use a different syntax than those function extensions to JSONPath but implementing something similar seems like a nice addition..

ohler55 avatar Apr 20 '22 12:04 ohler55

I added a discussion for this at #89. Lets use that for continuing the discussion.

ohler55 avatar Apr 20 '22 12:04 ohler55

This is really out of scope for the package and would be better implemented as a separate package.

ohler55 avatar Sep 13 '23 23:09 ohler55