COUNTIF-like aggregate function #337
Replies: 1 comment
-
Arquero does not at present have a count-if aggregation operator, and filtering predicates typically pass through Arquero's parsing and codegen infrastructure. Closures can't be passed down, except in non-aggregate/non-window contexts by using the special Currently a good way to achieve count-if functionality (without first filtering the whole table) is to use a
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I am having trouble aggregating data based on count filtered by a predicate (similar to how
COUNTIF
works in spreadsheets).I tried using
array_agg
like this:but it doesn't work this way.
Then, I tried creating a custom
countif
aggregate function that takes the predicate as a parameter, like this:but it doesn't work neither, as functions passed as parameters are ignored (
undefined is not a function
).For now, the only solution I found was using a very specific aggregate function like:
Is there any other way to do this? Am I using
array_agg
or custom aggregate functions wrong? I am still new to Arquero.Thank you very much for your help!
Beta Was this translation helpful? Give feedback.
All reactions