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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I am having trouble aggregating data based on count filtered by a predicate (similar to how
COUNTIFworks in spreadsheets).I tried using
array_agglike this:but it doesn't work this way.
Then, I tried creating a custom
countifaggregate 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_aggor 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