
Contributor
2021-10-13
06:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to count number of day grupped by Year-month, district, department where first transaction time is >8:30
Hello,
Could You help me with how to script aggr function?
I try to count amount of day in each month and in each district and department where first transaction in day started after 8:30 (where min (Time_transaction)>8:30) .
What I need in result:
District|Department|Year-Month|Count(Day)|Count(day where min (Time_transaction)>8:30)|Count(Time_transaction)
Diastric A|Office 1|2020-01|31|10|1500
District B|Office 1|2020-01|31|5|3153
District B|Office 2|2020-01|31|7|789
This is sample of my data:
id|Day|District|Department|Time_transaction
1|2020.01.01|District A|Office1|8:05
2|2020.01.01|District A|Office 1|8:10
......
50|2020.01.01|District B|Office 1|8:45
51|2020.01.01|District B|Office 1|8:55
52|2020.01.01|District B|Office 1|9:00
Thanks
Paulina
391 Views
0 Replies
