Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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'

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

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'

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)