Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
New navigation header in progress. Thank you for your patience: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

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
Not applicable
Author

stalwar1‌ pls help me look into this. Thanks

sunny_talwar

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
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

rupamjyotidas
Specialist
Specialist

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

sunny_talwar

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
Author

Hi Raul,

   Still same 'le problem.

rahulpawarb
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

Not applicable
Author

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

sunny_talwar

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

Thanks,

Sunny