Hello,
I've been trying many hours and ways but I'm not able to do something (new user here…)
I have a table with two columns:
-date-hour (data type: DateTime)
-values (data type: Double)
date-hour values
2020-04-01 06:00:14 2317.7
2020-04-01 07:00:14 2542.9
2020-04-01 08:00:16 2173.5
2020-04-01 09:00:14 2202.3
2020-04-01 10:00:14 2355.4
2020-04-01 11:00:15 2386.6
2020-04-01 12:00:16 2233.7
2020-04-01 13:00:14 2208.6
2020-04-01 14:00:14 1938.2
2020-04-01 15:00:14 1906.2
2020-04-01 16:00:15 2018.3
2020-04-01 17:00:16 1774
2020-04-01 18:00:15 2016.9
2020-04-01 19:00:16 2082.5
2020-04-01 20:00:16 2099.9
2020-04-01 21:00:15 2117.4
2020-04-01 22:00:14 1971.1
2020-04-01 23:00:15 2030.1
2020-04-02 00:00:16 2026.7
2020-04-02 01:00:16 1939.8
2020-04-02 02:00:16 2060.7
2020-04-02 03:00:16 2093.9
2020-04-02 04:00:15 1936.6
2020-04-02 05:00:15 1879
etc (many days)
I would like to sum the values for every day grouped by 3 working shifts:
- Morning shift: >= 06:00:00 and < 14:00:00
- Afternoon shift: >= 14:00:00 and < 22:00:00
- Night shift: >= 22:00:00 and < 06:00:00
Therefore, I should have something as follows:
date-shift values
2020-04-01 MS 18420.7
2020-04-01 AS 15953.4
2020-04-01 NS 15937.9
2020-04-02 MS 15759.2
etc
etc
Thank you very much!