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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

if resident

i have tableA which is:

numberA

1

2

3

4

5

i have another tableB which is:

numberB

2

4

5

how can i add a column in tableA if the value in tableB then i add yes, if not, add no. which is:

numberA  check

       1         no

       2         yes

       3         no

       4         yes

       5         yes

shall i use if(numberA resident numberB, yes, no) ? thanks a lot

3 Replies
sunny_talwar

May be like this:

MappingTable:

Mapping

LOAD numberB,

           'Yes' as Flag

LOAD * INLINE [

numberB

2

4

5

];

TableA:

LOAD *,

           ApplyMap('MappingTable', numberA, 'No') as check

INLINE [

numberA

1

2

3

4

5

];

rupamjyotidas
Specialist
Specialist

Try This

numberB:

LOAD * INLINE [

numberB

2

4

5

];

numberA:

LOAD * INLINE [

numberA

1

2

3

4

5

];

Left Join

test:

Load

numberA,

'Yes' as Check

Resident numberA where Exists(numberB,numberA);

Final:

Load

numberA,

If (Len(Check)>0,'Yes' ,'No') as Check1

Resident numberA;

Drop table numberA;

maxgro
MVP
MVP

another option could be

TableB:

load * inline [

numberB

2

4

5

];

TableA:

load

  *,

if(Exists(numberB, numberA), 'yes', 'no') as FlagExists

inline [

numberA

1

2

3

4

5

];