You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
currently, PPL does not support conditional count. for instance, source=tbl | stats count_if(age > 18)
What solution would you like?
PostgreSQL support, FILTER clause, for instance, select count(*) FILTER (WHERE age > 18) FROM tbl. This is a SQL-specific implementation that doesn't fit into the PPL design.
Kusto support countif aggregation, for instance, tbl | summarize countIf(age>18). It is preferred solution.
Splunk support eval in aggregation, for instance, source=tbl | stats count(eval(age>18)). Semantically, this approach is not ideal—eval(age > 18) returns a boolean value, and counting the boolean results would yield the same count as if no filter were applied.
What alternatives have you considered?
Using condition function, NULLIF / IF / CASE with count, and NULL value should ignored by count, for instance, source=tbl | stats count(NULLIF(age < 18))
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
currently, PPL does not support conditional count. for instance,
source=tbl | stats count_if(age > 18)
What solution would you like?
select count(*) FILTER (WHERE age > 18) FROM tbl
. This is a SQL-specific implementation that doesn't fit into the PPL design.tbl | summarize countIf(age>18)
. It is preferred solution.source=tbl | stats count(eval(age>18))
. Semantically, this approach is not ideal—eval(age > 18) returns a boolean value, and counting the boolean results would yield the same count as if no filter were applied.What alternatives have you considered?
Using condition function, NULLIF / IF / CASE with count, and NULL value should ignored by count, for instance,
source=tbl | stats count(NULLIF(age < 18))
The text was updated successfully, but these errors were encountered: