Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What NOW() function will output??

stalwar1‌s@@@@@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
MVP
MVP

May be try with LastWorkDay. For example, if I use =LastWorkDate(Today(), 5), I get March 6th 2017. Is this sort of what you wanted? To get 5 working days forward from today?

Not applicable
Author

Yes, 5 working days from today. which part of the code should I change ??

Not applicable
Author

How will it be incorporated into the code above ?

sunny_talwar
MVP
MVP

Like this

IF(DECODE_PRIORITY='Medium' and Now() > LastWorkDate(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT'), 5)

Not applicable
Author

Hi Sunny,

  The 7 you changed to 5 is actually 7 working days. Sure the changes would affect the expected result??

sunny_talwar
MVP
MVP

Hahahaha it should... I am not 100% confident though.... But what do you loose by trying? 5-10 mins? I would give it a try to see if it works as your would expect or not

sunny_talwar
MVP
MVP

With this though

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

Not applicable
Author

I wouldn't know till it malfunctions lol. Unfortunately that's the sad part.

Not applicable
Author

Its giving me errors, where do I wrap the brackets ?? LastWorkDate(this bracket)

Not applicable
Author

And I want it applied to that +7 alone not the field RESOLVE_BEFORE.