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

List difference / delta between 2 columns in 2 different tables in load script

Hi There,

Is there a way to list differences between 2 tables in the load script.

Table 1:

NameValue
One10
Two20
Three30
Four40

Table 2:

Name
One
Two

I am trying to list the missing values in Table 2

The desired result should be: "Three" and "Four"

Thanks,

1 Solution

Accepted Solutions
hector_munoz
Specialist
Specialist

Hi Abhay,

Here you have a sample using Not(Exists()) functions:

T1:

LOAD * INLINE [

    F1

    One

    Two

    Three

    Four

];

T2:

LOAD * INLINE [

    F2

    One

    Two

];

T3:

LOAD     F1 AS F3

RESIDENT T1

WHERE    Not(Exists(F2, F1));

I hope it serves to you.

Regards,
H

View solution in original post

5 Replies
hector_munoz
Specialist
Specialist

Hi Abhay,

Here you have a sample using Not(Exists()) functions:

T1:

LOAD * INLINE [

    F1

    One

    Two

    Three

    Four

];

T2:

LOAD * INLINE [

    F2

    One

    Two

];

T3:

LOAD     F1 AS F3

RESIDENT T1

WHERE    Not(Exists(F2, F1));

I hope it serves to you.

Regards,
H

maxgro
MVP
MVP

another option could be

T1:

LOAD * INLINE [

    F1

    One

    Two

    Three

    Four

];

T2:

LOAD * INLINE [

    F2

    One

    Two

];

Result:

LOAD F1 as Field, 1 as InT1 Resident T1;

join (Result) load F2 as Field, 1 as InT2 Resident T2;


1.png

MarcoWedel

Hi,

yet another solution might be:

QlikCommunity_Thread_247714_Pic1.JPG

QlikCommunity_Thread_247714_Pic2.JPG

QlikCommunity_Thread_247714_Pic3.JPG

Table2:

LOAD Name,

    Name as NameTable2

FROM [https://community.qlik.com/thread/247714] (html, codepage is 1252, embedded labels, table is @2);

Table1:

LOAD *,

    -Exists(NameTable2, Name) as IsInTable2

FROM [https://community.qlik.com/thread/247714] (html, codepage is 1252, embedded labels, table is @1);

DROP Field NameTable2;

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Thanks for helping out. This works for me.

MarcoWedel

you're welcome

glad it helped

please close your thread if your question is answered:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco