Running total

I've successfully used an aggregation addon to recursively query the same table. This means that I can get a grand total in the same response as the query response list.

However, I can't get the addon query to include a '< =' timestamp filter, which would provide a running total. I'm passing the auth.id from the API call into the 'main' query, and then onto the addon query to filter by user, but of course this is a fixed value. For a running total I need to pass or self-reference a variable - that is, each db entry's own timestamp.

Any chance this is possible?!

I do have this currently working in a loop, but as I want to allow users to apply front-end filters, I'm hoping to speed it up a little.

Thanks

5 replies