3 Replies Latest reply: Jul 12, 2013 3:30 AM by Bernard Herrok

# Set Analysis using Exists and OR

Hi Community,

I'm trying to replicate the following logical rule in QlikView using Set Analysis:

(appointments where the starting planned date is less than the current report date

AND appointments where the created date is less than the current report date)

AND

(appointments where the actual starting is greater than the current report date

OR appointment is planned)

Essentially the SQL statement looks like (assuming the report date is 2013-06-30):

WHERE [Planned_Appointment_Start_Date] < '2013-06-30'

AND [Appointment_Created_Date] < '2013-06-30'

AND ([Appointment_Start_Date] > '2013-06-30'

OR [Is_Planned_Appointment] = 1)

Can anyone please assist?

• ###### Re: Set Analysis using Exists and OR

See the attached file

• ###### Re: Set Analysis using Exists and OR

Hi

Something like this:

{<Planned_Appointment_Start_Date = {"<'2013-06-30'"},

Appointment_Created_Date = {"<'2013-06-30'"},

Appointment_Start_Date = {">'2013-06-30'"}>

+ <Is_Planned_Appointment = {1}>}

Jonathan

• ###### Re: Set Analysis using Exists and OR

Thanks for you input guys, but the correct set analysis in the end was:

{<Planned_Appointment_Start_Date = {"<'2013-06-30'"},

Appointment_Created_Date = {"<'2013-06-30'"},

Appointment_Start_Date = {">'2013-06-30'"}>

+ <Appointment_Created_Date = {"<'2013-06-30'"},

Planned_Appointment_Start_Date = {"<'2013-06-30'"},

Is_Planned_Appointment = {1}>}

Because the Planned_Appointment_Start_Date and Appointment_Created_Date are outside the or bracket, they must be applied to both.

Thanks again for the input.