Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
what do you mean? I am not sure I understand you want to apply this to +7 alone?
Hi Sunny,
It doesn't really Matter, but hwhere do I wrap the LastWorkingDate() in the code below ??? I tried it and its giving me errors.
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
from my understanding, may be this:
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()>LastWorkDate(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
Hi Sunny,
This is a weird question, cause I shld have known by now, lets say I wanna test that line and see the output, how do I go about it ??
Just that line? I don't think it would be possible. I think you will have to run the whole application and look for a row that match the criteria and see if the result is what you expect.
it is working fine now, but isn't there anyway, I can see the exact day(In date) the LastweekDate() made the code to become??
Oh ya, you can add another field in your script like this
LastWorkDate(TimeStamp#(SubField(RESOLVE_BEFORE, ' ', 1) & ' ' & Trim(Mid(RESOLVE_BEFORE, Len(SubField(RESOLVE_BEFORE, ' ', 1)) + 1)), 'MMMM DD, YYYY hh:mm:ssTT'), 7) as TestTestTest
Now create a table with two fields
RESOLVE_BEFORE
TestTestTest
and see there relationship
hmmm Sunny,
I envy you really. You're so good, its working. Thank you.
Its all trial and error my friend . I don't hesitate in trying. What do you have to loose here by trying, right?
One last thing, for any additional thing, I would suggest you to create a new thread as it is not very helpful for other users when a thread becomes extremely long. Although all your questions were related to your initial question, but breaking it out might help in two ways
1) Your question will get greater exposure
2) Future visitors won't have a difficult time to understand the thread.
Best,
Sunny