Forum Discussion
Grouping Data by Date Range and "Shift"
- 4 years ago
So far, in addition to the datetime column I had in the original post, I now have the following columns as I test possible solutions:
TIME = VALUE(FORMAT([Created], "hh:mm:ss")) SHIFT = SWITCH(true(), [TIME]>=0.25 && [TIME]<0.584, 1, [TIME]>=0.584 && [TIME]<19.2, 2, 3)I had issues with the SWITCH statement initially (a problem with text comparisons etc.) so converting the timestamp into a numeric value using the VALUE function allowed me to identify shifts, as above (where 1, 2 and 3 output values represent the different shifts).
So far, in addition to the datetime column I had in the original post, I now have the following columns as I test possible solutions:
TIME = VALUE(FORMAT([Created], "hh:mm:ss"))
SHIFT = SWITCH(true(), [TIME]>=0.25 && [TIME]<0.584, 1, [TIME]>=0.584 && [TIME]<19.2, 2, 3)
I had issues with the SWITCH statement initially (a problem with text comparisons etc.) so converting the timestamp into a numeric value using the VALUE function allowed me to identify shifts, as above (where 1, 2 and 3 output values represent the different shifts).