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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loop Through Values (Normal If statement Not Working)

Hi All

I Have a Table which looks like this:

Member Status A Status B

1 1 -

1 2 -

1 3 -

1 - 1

1 - 4

1 - 6

Now if i Do a Normal If Statement:

IF([Status A] = [Status B],1)

Then it doesn't work as the IF Statement works Line Per Line.

Now i need to do something to loop through the values to see if the values are infact there. Not line per line. Like:

IF([Status A] In [Status B],1) (In Function in SQL, don't know if there is something like this in Qlikview)

Please Assist.

Thanks in advance.

Jandre

1 Reply
Miguel_Angel_Baeyens

Hello Jandre,

There's probably a cleaner solution, but one I'm thinking of at a first glance is

StatusB: // loads in memory all possible values of Status BLOAD DISTINCT [Status B] AS CheckBFROM Table; Data:LOAD Member, [Status A], [Status B], IF(EXISTS(CheckB, [Status A]), 1) AS AinB // Check values for Status A in Status BFROM Table; DROP TABLE StatusB;


Hope that helps