Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jmonroe918
Creator II
Creator II

If, Then, Else Statement with Multiple Conditions in Load

I am trying to create a load statement that populates a field called 'LateFlag' and want it to get filled with either on of 3 entries: "Not Applicable", "On-Time" and "Past-Due".


The conditions are as follows:


  1. If 'Status' = "Issue Findings","Acknowledged", "Released" or "Closed"; Then enter "Not Applicable into 'LateFlag'.
  2. If 'Status' = "Pending", "Scheduled" or "Execute"  AND Today() is <= 'DateDue'; Then enter "On-Time" into 'LateFlag'.;
  3. Else enter "Past-Due into 'LateFlag' (These are considered late).

The code statement I am trying is:

If(Audits.Status = 'Issue Findings' or 'Acknowledge' or 'Released' or 'Closed', 'Not App', if(Audit Status = 'Pending', 'Scheduled' or 'Execute' AND Today() <= DateDue, 'On-Time', 'Past-Due))

as AuditLateFlag


Which, I know the syntax is incorrect and I'm trying to search for the correct way to write it.


Any help is very much appreciated. Thanks.


Jeff

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

If([Audits.Status] = 'Issue Findings' or [Audits.Status] = 'Acknowledge' or [Audits.Status]= 'Released' or [Audits.Status] = 'Closed', 'Not App', if([Audit Status] = 'Pending', ([Audit Status] = 'Scheduled' or [Audit Status] = 'Execute') AND Today() <= DateDue, 'On-Time', 'Past-Due)) as AuditLateFlag


Make sure, With your date format of DateDue. Today() always gives 'DD-MM-YYYY'

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

Try this?

If([Audits.Status] = 'Issue Findings' or [Audits.Status] = 'Acknowledge' or [Audits.Status]= 'Released' or [Audits.Status] = 'Closed', 'Not App', if([Audit Status] = 'Pending', ([Audit Status] = 'Scheduled' or [Audit Status] = 'Execute') AND Today() <= DateDue, 'On-Time', 'Past-Due)) as AuditLateFlag


Make sure, With your date format of DateDue. Today() always gives 'DD-MM-YYYY'

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
jmonroe918
Creator II
Creator II
Author

Anil:

A bit late, but thanks for the solution. It worked great!

Jeff

Anil_Babu_Samineni

Glad it worked

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful