Forum Discussion
mrolly
1 year agoRegular Visitor
Help: Insert Shift into Data Table Based On Time Parameters
Hello Internet Friends, I'm having trouble figuring out how to insert a column into a datatable that I'm querying in, to show what particular shift a Transaction Time fell within. I'll then be us...
FreemanZ
1 year agoSuper User
hi mrolly ,
try to write a calculated column like:
Column =
VAR _time = [Transaction Time] -TRUNC([Transaction Time])
RETURN
SWITCH(
TRUE(),
_time >= 7/24&&_time<15.5/24,
"Shift1",
_time >=15.5/24&&_time<1/24,
"Shift2"
)
- mrolly1 year agoRegular Visitor
Hey FreemanZ ! Thank you so much for taking an attempt at this. I inserted your formula into the Table and it returned the 1st Shift properly, but failed on the 2nd Shift. I think it may have to do with the AM/PM of the Transaction Times, but I'm not certain. Have a look down below.
Maybe it's adding a statement that if Blank, show the text "2nd Shift"?