Reputation: 119
I have data in this format on S3 I am using athena to generate aggregate results after join on 2 key columns
Requirement -
At country level, I have to calculate count of events at daily, weekly and monthly level So for japan in month of oct two events, weekly one event should show as result.
Expected result -
when i join on country and event_date == transaction_date
Upvotes: 0
Views: 900
Reputation: 1270331
Hmmm . . . If I am following your question you can use window functions in a subquery and then filtering:
select t.*
from (select t.*,
count(*) over (partition by eventdate) as day_count,
count(*) over (partition by week) as week_count,
count(*) over (partition by month) as month_count
from t
) t
where eventdate = :transactiondate
Upvotes: 1