Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
The below expression is not working as expected because the condition inisde if statement is never returning true value in expression of a chart, but the same condition is working fine when it was applied in a dimension. kindly assist
Expression: =if(Time(Timestamp#( Date(num(%ShiftDate)+1,'DD/MM/YYYY') &' '&EndTime,'DD/MM/YYYY hh.mm TT')) > Time(outtime),
[Late Time 2],'0')
--> [Late Time 2] = Time(Only({<%ShiftDate={'>=$(=Date(vStart))<=$(=Date(vEnd))'},MonthYear>}
(Timestamp#(Date(num(%ShiftDate)-1,)&' '&EndTime,'DD/MM/YYYY hh.mm TT')-outtime)),'hh:mm')
Hi,
Firstly I want to say that if you only need to compare the "time", it seems like that the "%ShiftDate" is useless.
And what's your dimension in this table, and your data model also affect the result.
It's better to share a small sample, so we can find the real reason.
Thanks.
Aiolos Zhao
Hi All,
Since data is confidential i wont be able to share the data, The dimension includes %shiftdate (DD/MM/YYYY) and shift start date (Example: 10 AM) , shift end time (4 PM).
Thanks
Siva
Partially correct.
There are possible scenario where shift end time is 2 am or 3 am (Next day time stamp) , hence =if(Time(EndTime) > Time(outtime),1,0) doesn't meet the expectation. I tried with below code in expression to identify late night shift time , but that doesn't work expected.
FYI, end time value is like '2:00 AM' whereas outime is swipe out timestamp value ('05-01-2018 01:06 AM') , so i am trying to add shiftdate ('04-01-2018') + 1 for shift end time containing '*Am*'.
if( Wildcard(EndTime,'*AM*'),
if(Time(Timestamp#( Date(num(%ShiftDate)+1,'DD/MM/YYYY') &' '&EndTime,'DD/MM/YYYY hh.mm TT')) > Time(outtime),
[Late Time 2],'0'),0)
--> [Late Time 2] = Time(Only({<%ShiftDate={'>=$(=Date(vStart))<=$(=Date(vEnd))'},MonthYear>}
(Timestamp#(Date(num(%ShiftDate)-1,)&' '&EndTime,'DD/MM/YYYY hh.mm TT')-outtime)),'hh:mm')
The above logic is not working. Kindly assist.