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

if condition with same value

hi Community,

I am finding the way to create 2 different attributes with same value like below.

Dim1

A

B

C

D

E

F

I am trying to create below condition based on above data(Dim1)

if(match(Dim1,'A','B','C','D'),'Cons',

if(match(Dim1,'A','B'),'AB_Cons')) as Cons_Filter

I want both to be populated Cons and 'AB_Cons' under Cons_Filter but values are filter first level itself so I am getting only 'Cons'.

Can someone please help if we have any work around to get desired values.

_priya

5 Replies
sunny_talwar

May be try like this

LinkTable:

LOAD 'Cons' as Cons_Filter,

     Dim1

Resident Table

Where match(Dim1,'A','B','C','D');


Concatenate(LinkTable)

LOAD 'AB_Cons' as Cons_Filter,

     Dim1

Resident Table

Where match(Dim1,'A','B');

priyarane
Specialist
Specialist
Author

Thanks Sunny, I tried this but lot of columns I have to hard code, so do we have any other approach like by hirarchy.

sunny_talwar

Not sure I understand? You have to hard-code the values within the Match statement? But you were doing the same for your if statement also?

priyarane
Specialist
Specialist
Author

it is like

under A --- ABCD

for B -- BC

For C- C

For D - DE

like that

sunny_talwar

Still not sure what you mean....