Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ishika00730
Contributor III
Contributor III

How to load only uncommon records from the data set

Hi,

I have two tables to load in my application. The requirement is to load only the uncommon records that exist in Table 2 .The records need not to be in my application.

Please find the below script and suggest how can I achieve this result.

a:
LOAD * INLINE [
ID, Name
1, A
2, B
3, C
4, D
5, E
];

B:
LOAD * INLINE [
ID, Name
1, A
2, B
3, C
4, D
5, E
6, F
7, G
8, H
] ;

 Output :  I need to have only IDs- 6,7,8 in my application rest all the common IDs to be dropped.

Thanks

Ishika

 

3 Replies
saurabhwadhwa
Partner - Contributor III
Partner - Contributor III

Hi,

Please try below script.

a:
LOAD * INLINE [
ID, Name
1, A
2, B
3, C
4, D
5, E
];

NoConcatenate
B:
LOAD * WHERE NOT EXISTS ( ID,ID);
LOAD * INLINE [
ID, Name
1, A
2, B
3, C
4, D
5, E
6, F
7, G
8, H
] ;


DROP TABLE a;

Hope this helps you.

BR, 

Saurabh

vardhancse
Specialist III
Specialist III

Hi,

Adding to above can try something like mentioned below:

Main1:
LOAD * INLINE [
ID, Name
1, A
2, B
3, C
4, D
5, E
];

join
Main2:
LOAD * INLINE [
ID1, Name
1, A
2, B
3, C
4, D
5, E
6, F
7, G
8, H
];

NoConcatenate

Main:
Load *
Resident Main1
where IsNull(ID) or IsNull(ID1);

Drop Table Main1;

 

PFA sample app for your reference:

JaMajka1
Partner Ambassador
Partner Ambassador

Hi,
I would do it also by using where not exists(). Just for being efficient - if both fields have the same name you can write it only once. So the condition where not exists(ID) works the same ;).
BR,
Maria