Created
August 8, 2020 21:52
-
-
Save snehamehrin/c98ec4fb9dcc151454d239b0f4da4199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
q = load "stack_overflow_dataset"; | |
q = filter q by date('creation_date_Year', 'creation_date_Month', 'creation_date_Day') in ["current month".."current month"]; | |
result = group q by 'creation_date_Day'; | |
result = foreach result generate q.'creation_date_Day' as 'creation_date_Day', unique(q.'questionid') as 'A'; | |
u = load "stack_overflow_dataset"; | |
u = filter u by date('creation_date_Year', 'creation_date_Month', 'creation_date_Day') in ["1 year ago".."current month - 1 year"]; | |
u = foreach u generate u.'creation_date_Day' as 'creation_date_Day', unique(u.'questionid') as 'B'; | |
final_result =cogroup result by 'creation_date_Day' left,u by 'creation_date_Day'; | |
final_result=foreach final_result generate result.'creation_date_Day' as 'Day',sum(result.'A') as 'Current_Year',coalesce(sum(u.'B'),0) as 'Previous_Year'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment