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: 
markgraham123
Specialist
Specialist

General if statement

Hi,

I'm trying to create a new fileds using and in if statement. But i'm not getting any result.

But a simple if statement is not working. I know there should be something wrong in my syntax.

Can someone please help?

Table1:

LOAD * Inline

[

ID, Name

1,A

1,B

1,C

1,D

1,E

];

Table2:

LOAD *,

If(Name='A' and Name='B' and Name='D' and Name='D' and Name='E' , 'special') as test

Resident Table1;

DROP Table Table1;

10 Replies
MarcoWedel

Hi,

I guess you're looking for a category based on the actual name sequence, so one solution to this problem might be:

QlikCommunity_Thread_271160_Pic1.JPG

mapCategory:

Mapping LOAD * Inline [

NameSequence, Category

ABCDE, normal

ABDDE, special

EDCBA, reverse

];

Table1:

LOAD * Inline

[

ID, Name

1,A

1,B

1,C

1,D

1,E

2,A

2,B

2,D

2,D

2,E

3,E

3,D

3,C

3,B

3,A

];

Join

LOAD ID,

    ApplyMap('mapCategory',Concat(Name,'',RecNo())) as Category

Resident Table1

Group By ID;

hope this helps

regards

Marco