Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Statement bringing up wrong output

Hi All,

   can anyone help me with this codes below:

LOAD*,

   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()>LastWorkDate(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()>LastWorkDate(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;

LOAD *,

   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 = 'BRONZE',

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

  IF(TIER = 'SILVER',

   IF(DECODE_PRIORITY ='High' AND NOW()>LastWorkDate(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()>LastWorkDate(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;

===================================================================================================

The first LOAD statement works, but the second works but bring up the wrong set of selections and the highlighted line is the only difference between them. stalwar1‌   Sunny pls help me with this. Thanks

32 Replies
sunny_talwar

Not at all... I just need some time to understand what is going on

sunny_talwar

I have not got time to look at this, but did you manage to get this resolved?

Not applicable
Author

not at all. just don't know why it is not working.