Aggregate functions in org-ql-query
Is there a simple way to run aggregate functions in :select when using org-ql-query? For example, get a count of all results matching some criteria.
I could just count the results with elisp, but it would be nice to have a syntax in org-ql-query that makes things like this concise.
If this doesn't exist and it seems like a good idea, I'd be happy to take a swing at implementing it :)
Hi,
There's nothing like that implemented yet, but it's an interesting idea. You could use simply, e.g. :select t and then wrap org-ql-query in length. Or if you want to be more memory-efficient, you could bind a count variable and increment it in the :select expression.
I'm not necessarily opposed to having a built-in count action, so feel free to propose something. :) Thanks for the suggestion.