Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What NOW() function will output??

stalwar1s@@@@@who knows what the now function used below in my expression will produce??

IF(TICKET_STATUS = 'WORK IN PROGRESS' OR TICKET_STATUS='HOLD' OR TICKET_STATUS='ASSIGNED' OR TICKET_STATUS='NEW',

IF(TIER='GOLD' AND NOW()>RESOLVE_BEFORE,'OUT_OF_SLA','IN_SLA'),

IF(TIER='SILVER',

IF(DECODE_PRIORITY ='High' AND (NOW()+2)>RESOLVE_BEFORE,'OUT_OF_SLA',

IF(DECODE_PRIORITY='Medium' AND (NOW()+7)>RESOLVE_BEFORE,'OUT_OF_SLA',

IF(DECODE_PRIORITY='Low' AND (NOW()+10)>RESOLVE_BEFORE,'OUT_OF_SLA','IN_SLA')))))

I want the number(2) in  (NOW()+2) to be in DAYs and not HOURS??

e.g NOW()+2DAYS

92 Replies
sunny_talwar

Here you are

If(Match(TICKET_STATUS, 'WORK IN PROGRESS', 'HOLD', 'ASSIGNED', 'NEW'),

  If(TIER = 'GOLD',

      IF(Now() > TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT'),'OUT_OF_SLA','IN_SLA'),

      IF(TIER = 'SILVER',

        IF(DECODE_PRIORITY ='High' AND NOW()>(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT')+2),'OUT_OF_SLA',

            IF(DECODE_PRIORITY='Medium' AND NOW()>(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT') +7),'OUT_OF_SLA',

            IF(DECODE_PRIORITY='Low' AND NOW()>(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT') + 10),'OUT_OF_SLA','IN_SLA')))))) as OPEN_SLA

Capture.PNG

Not applicable
Author

woooow. you're a genius. There is no way on earth I would have done this alone. Thanks so much.

sunny_talwar

Yes you would have.... you just had to piece meal it together with a pinch of patience....

Not applicable
Author

Hi Sunny,

   Sorry to disturb you once again. But after getting past a hurdle, we would wanna do more, natural for human loool. so look at the conditional statement, is it possible a function can be added to the +days I added to the RESOLVE_BEFORE to automatically recognise the weekend days i.e sat and sunday and not include them??

sunny_talwar

I am not sure I completely understand your question

Not applicable
Author

hi Sunny,

  IF(DECODE_PRIORITY='Medium' AND NOW()>(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT') +7),
sunny_talwar

what about this code Victor?

Not applicable
Author

Its working perfectly fine and I could continue with this, but I just want to see if it is possible for the code to recognise weekend days?? and if there isn't, its no problem.

Not applicable
Author

I am only striving for perfection lool

Not applicable
Author

oh sorry, it ddnt post it all.

IF(DECODE_PRIORITY='Medium' AND NOW()>(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT') +7),

I was saying the +7 in the above code which is technically represents +7days, is there anyway, we could add a function that the 7 days doesn't include weekend days just the 5 working days of the week??