Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

my IF conditional statement would not Run

Hi All,

   who can help me look at this, my qlik sense script is highlighting it as wrong;

LOAD *,

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

    IF(TIER='GOLD' AND NOW() > TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT'),'OUT_OF_SLA',

    else IF(TIER='SILVER',

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

    else IF(DECODE_PRIORITY='Medium' AND NOW()>(TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT') +7),'OUT_OF_SLA',

    else IF(DECODE_PRIORITY='Low' AND NOW()>(TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT') + 10),'OUT_OF_SLA','IN_SLA')))))) AS OPEN_SLA

I don't see anything wrong with this.

1 Solution

Accepted Solutions
Highlighted

I think part of the issue was Resolve_Before field (you guys can look at the sample here)

What NOW() function will output??

View solution in original post

9 Replies
Highlighted
Not applicable

stalwar1‌ pls help me look into this. Thanks

Highlighted

Yes, there is no ELSEIF in Qlik products... Would you be able to share few rows where the expected output doesn't match based on the fields from the above condition?

Highlighted
Specialist III
Specialist III

Hello Victor,

You can refer below given sample script:

LOAD *,

    IF(

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

       IF(TIER='GOLD' AND NOW() > TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT'),

       'OUT_OF_SLA',

   IF(TIER='SILVER',

      IF(DECODE_PRIORITY ='High' AND NOW()>(TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT')+2),

     'OUT_OF_SLA',

  IF(DECODE_PRIORITY='Medium' AND NOW()>(TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT') +7),

    'OUT_OF_SLA',

    IF(DECODE_PRIORITY='Low' AND NOW()>(TimeStamp#(RESOLVE_BEFORE, 'MMMM DD, YYYY hh:mm:ssTT') + 10),

       'OUT_OF_SLA','IN_SLA')))))) AS OPEN_SLA

Hope this will be helpful.

Regards!

Rahul

Highlighted
Specialist
Specialist

You may have to write each If else separately and concatenate all them together

Highlighted

I think part of the issue was Resolve_Before field (you guys can look at the sample here)

What NOW() function will output??

View solution in original post

Highlighted
Not applicable

Hi Raul,

   Still same 'le problem.

Highlighted
Specialist III
Specialist III

Hello Victor,

Sincere apologies for caused inconvenience.

Could you please share the application with sample data? This will help us to understand the problem and provide required feedback.

Regards!

Rahul

Highlighted
Not applicable

Hi Raul,

     please follow the link SUNNY TAWAL posted below, I shared it on there. for confidential reasons I wouldn't wanna share it allover. Please follow the link. Cheers

Highlighted

Close this thread by marking 'Assumed Answer' since the other thread has already resolved you issue.

Thanks,

Sunny