Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
unable to use IF condition on below expression in table.
Interval(Timestamp(aggr(MAX(A_DATE),REQ_ID))-Timestamp(aggr(Min(T_DATE),R_ID)),'hh')
for example -
if the result of the expression is 170 hours then i want to apply if condition as below
IF(Interval(Timestamp(aggr(MAX(ACTION_DATE),REQ_ID))-Timestamp(aggr(Min(TRANS_DATE),REQ_ID)),'hh')<=170,'True','False') but its not returning me result.
Interval() is a formatting function, i.e. - it doesn't change the value internally. In other words, if interval() shows you 1 from 'hh' formatting that is not actually 1 that you can compare. You can use hour() to extract the hour number from a timestamp.
Hi Tresesco,
Thank you for response.
kindly help me with above expression with hour
Well, since your timestamp difference could go beyond 1 day, hour() might not suit here. Try like:
If ((Timestamp(aggr(MAX(A_DATE),REQ_ID))-Timestamp(aggr(Min(T_DATE),R_ID)) )*24 <=170, 'True', 'False')
This is not returning correct result
The issue could be somewhere else, like your aggr(), chart dimensions or the timestamp field value type... Try to share a sample app with data set explaining the expected output; then we could have a look to fix the issue