-
I'm trying to aggregate various simple statistics such as min, max, and mean with topk results in a single query so that I can use it in a table expression, but I'm not having much luck. I have the following aggregate.
This is the error I'm getting.
|
Beta Was this translation helpful? Give feedback.
Answered by
cpcloud
Sep 24, 2022
Replies: 1 comment 5 replies
-
Hey @kesmit13, thanks for opening a discussion about this. I think you'll have to do a join: t.aggregate(
name=ibis.literal("Survived"),
min=_.Survived.min(),
max=_.Survived.max(),
mean=_.Survived.mean(),
).cross_join(t.Survived.topk(1).to_aggregation()) I tried this with some public ClickHouse data:
There might be ways we can make this more convenient, like not requiring the |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
kesmit13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @kesmit13, thanks for opening a discussion about this.
I think you'll have to do a join:
I tried this with some public ClickHouse data: