Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to "outer keep" a table?

Hello All,

I am still a newbie to Qlik, so please bear with my stupid questions.

I have two tables (TABLE1 and TABLE2) that coming from 2 different data sources that can be linked by one key.  TABLE2 is a super set of TABLE1, ie all keys in TABLE1 will be found in TABLE2, but TABLE2 contains more keys than TABLE1.

What I want to do is to load them, join by this key and keep them in two separate tables within Qlik.  From what I have read in Qlik's reference manual, what I need is an "OUTER KEEP", but that doesn't seem to be allowed.

Graphically:

TABLE1:

KeyField1Field2
1aabb
2ddee

TABLE2:

KeyField
1hh
2kk
3ll
4oo
5pp

I need both tables loaded (IN FULL), linked by key, but separated.

Is this possible?

Kind regards

2 Replies
sunny_talwar

Not sure if you want Table1 to have ID 3, 4, 5 with field1 and Field2 as Nulls?

May be this:

Table1:

LOAD Key,

     Field1,

     Field2

FROM

[https://community.qlik.com/thread/215100]

(html, codepage is 1252, embedded labels, table is @1);

Concatenate(Table1)

LOAD Key

FROM

[https://community.qlik.com/thread/215100]

(html, codepage is 1252, embedded labels, table is @2)

Where not Exists(Key);

Table2:

LOAD Key,

     Field

FROM

[https://community.qlik.com/thread/215100]

(html, codepage is 1252, embedded labels, table is @2);

or are you just looking to have a connection between the two (and not include the extra ids?) If that is the goal, you don't need to do anything. Just load them and the connection will be automatically formed because they are named the same.

Table1:

LOAD Key,

     Field1,

     Field2

FROM

[https://community.qlik.com/thread/215100]

(html, codepage is 1252, embedded labels, table is @1);

Table2:

LOAD Key,

     Field

FROM

[https://community.qlik.com/thread/215100]

(html, codepage is 1252, embedded labels, table is @2);

Not applicable
Author

Thanks!

What I ended up doing, since Table B is a superset of Table A, I simply loaded Table B firstly then "left keep TableA"...

Please apologise for the very stupid question.