Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

Re: my IF conditional statement would not Run

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

What NOW() function will output??

9 Replies
Not applicable

Re: my IF conditional statement would not Run

stalwar1‌ pls help me look into this. Thanks

Re: my IF conditional statement would not Run

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?

rahulpawarb
Valued Contributor II

Re: my IF conditional statement would not Run

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

rupamjyotidas
Valued Contributor

Re: my IF conditional statement would not Run

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

Re: my IF conditional statement would not Run

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

What NOW() function will output??

Not applicable

Re: my IF conditional statement would not Run

Hi Raul,

   Still same 'le problem.

rahulpawarb
Valued Contributor II

Re: my IF conditional statement would not Run

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

Not applicable

Re: my IF conditional statement would not Run

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

Re: my IF conditional statement would not Run

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

Thanks,

Sunny

Community Browser