Skip to content
Advertisement

Create A shift summary, with a shift spanning over 2 days

I have a data set like the sample below. I need to query and summarize the number of transactions per shift. The problem is that the shift cycle does not align with the normal hours of a day.

Eg. The shift for day 2020-01-01 will start at 06:00 AM on 2020-01-01 and end at 06:00 AM on 2020-01-02

Below are an sample data set.

The desired results need to look like this.

Any help will greatly be appreciated.

Advertisement

Answer

You can just add a 6 hours offset to the transaction date, and then aggregate like so:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement