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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Domino1
Contributor II
Contributor II

Is it possible to combine 3 'IF' statements into one flag ?

  Below are 4 conditions as required:

 

1,  If (StartMonth > EndMonth , 0,1 )

2, If (StartMonth = EndMonth, 0,1) 

3.  If ((StartMonth  < EndMonth  )   AND  If (StartYear < EndYear  ), 0, 1) 

 

The AND function on #3 does not seem to work  but no issues if I separate the the 2 conditions. 

How can I combine ALL 3 conditions into 1 FLAG ?

 

Labels (1)
1 Solution

Accepted Solutions
vchuprina
Specialist
Specialist

Hi,

If (StartMonth > EndMonth , 0 ,

   If (StartMonth = EndMonth, 0,

      If (StartMonth  < EndMonth   AND  StartYear < EndYear ,  0,  1))) AS Flag

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

1 Reply
vchuprina
Specialist
Specialist

Hi,

If (StartMonth > EndMonth , 0 ,

   If (StartMonth = EndMonth, 0,

      If (StartMonth  < EndMonth   AND  StartYear < EndYear ,  0,  1))) AS Flag

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").