Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

joaquinlr
Valued Contributor II

LOAD + IF to other table

Hello:

I've this script

Table1:

LOAD KeyField, Field12, Field13, Field14 ..

Table2:

LOAD KeyField, Field22, Field23, Field24 ..


I need to create a new boolean field  calculated (NewField) on Table2 thats indicates if KeyField is or not in Table1.

I've thought in a mapping table created from resident Table1 and an applymap in Table2 LOAD instruction


Map:

MAPPING

LOAD KeyField, 'Yes' as NewField

Resident Table1


(In Table2 LOAD)  Applymap('Map', KeyField, 'No) as NewField


Is there any easy way, a function or a smart way to do it ?


Thank you

Joaquín

1 Solution

Accepted Solutions
anbu1984
Honored Contributor III

Re: LOAD + IF to other table

Table1:

LOAD KeyField, Field12, Field13, Field14 ..

Table2:

LOAD KeyField, Field22, Field23, Field24 ..,If(Exists(KeyField),'Present','Not P') As Flag...

3 Replies
anbu1984
Honored Contributor III

Re: LOAD + IF to other table

Table1:

LOAD KeyField, Field12, Field13, Field14 ..

Table2:

LOAD KeyField, Field22, Field23, Field24 ..,If(Exists(KeyField),'Present','Not P') As Flag...

ankitaag
Contributor III

Re: LOAD + IF to other table

Table1:

LOAD KeyField, Field12, Field13, Field14 ..

Table2:

LOAD KeyField, Field22, Field23, Field24 ,Yes as Flag

where exists (KeyField)

concatenate

Table3:

LOAD KeyField, Field22, Field23, Field24 ,No as Flag

where not exists (KeyField)

joaquinlr
Valued Contributor II

Re: LOAD + IF to other table

Thank you anbu1984 it works fine.

Community Browser