Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression aggregations #3365

Closed
salsakran opened this issue Sep 16, 2016 · 3 comments
Closed

Expression aggregations #3365

salsakran opened this issue Sep 16, 2016 · 3 comments
Milestone

Comments

@salsakran
Copy link
Contributor

We should allow the equivalent of druid post aggregations to do things like divide a result by a constant or once #3364 is in place calculate things like averages.

@underyx
Copy link

underyx commented Oct 11, 2016

This would make it possible to take a table like

source visits conversions
search 100 20
referral 200 10
direct 300 0

and query for sum(sales) / sum(users), to get the total conversion rate of 5%, right? Cause if so, I won't create a duplicate feature request for that 👯‍♂️

@camsaul camsaul added this to the 0.22.0 milestone Dec 12, 2016
@camsaul camsaul changed the title Allow post-aggregation math operations Expression aggregations Dec 12, 2016
@jbelke
Copy link

jbelke commented Jan 27, 2018

v0.27.2 Built on 2017-12-12
Post Aggregates Failing.

custom expression
=Sum(¨Transaction Revenue¨) / Sum(Transactions)

If grouped by Timestamp, daily raw works.

Native Query:
{ "intervals":[ "1900-01-01/2100-01-01" ], "granularity":"all", "context":{ "timeout":60000 }, "queryType":"select", "pagingSpec":{ "threshold":1048576 }, "dataSource":"ChannelGrouping", "postAggregations":[ { "type":"arithmetic", "name":"AoV Test - ", "fn":"/", "fields":[ { "type":"fieldAccess", "fieldName":"___sum_549" }, { "type":"fieldAccess", "fieldName":"___sum_550" } ] } ], "descending":false }

@Octivian
Copy link

@jbelke v0.28.1 same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants