Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
omid5ive
Creator II
Creator II

difference between two table

hi

i have two table like below :

A
1
2
3
B
1
3
4
5

i want two have difference of this two table like blow:

C
4
5

how can i do this?

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Flip the order of the two tables and then the Not( Exists(  .... logic can work as you want it to:

C:

LOAD A

FROM

factor.xlsx

(ooxml, embedded labels, table is Sheet1)

;

A:

LOAD

  B

WHERE Not( Exists( 'A' , B ) )

;

LOAD (RecNo() + 0) AS B

AUTOGENERATE 10

;

View solution in original post

16 Replies
Kushal_Chawda

TabA:

Load A

From TableA;

TabB:

Load B

From TableB

where not exist(A,B);

Drop table TabA;

omid5ive
Creator II
Creator II
Author

hi

i attached my file with your solution but it cant show anything

petter
Partner - Champion III
Partner - Champion III

You have to fix your load script and write this:

WHERE Not( Exists( 'Factor_Number1' , number ) ) ;

You were missing paranthesis ( ) for the Not()-function and you have to quote the field name 'Factor Number1' with single quotes...

petter
Partner - Champion III
Partner - Champion III

2015-10-11 #2.PNG

omid5ive
Creator II
Creator II
Author

i think i cant use not exist with auto generate command.

is it true?

cause when  create A table in excel i can get correct answer with your solution

petter
Partner - Champion III
Partner - Champion III

QlikView when it performs the Exists()-function does not care if the field it checks against (the first parameter) is originally populated by and AutoGenerate. The AutoGenerate populates a table with one or more fields and these fields are on the following script statements first-class fields without any restrictions or limitations compared to any other fields which comes from other sources...

So the answer must be ... the problem is elsewhere

omid5ive
Creator II
Creator II
Author

sorry

can you check my attached document?

petter
Partner - Champion III
Partner - Champion III

Your code is working as expected in my eyes. The AutoGenerate makes an exclusion list of ten numbers from 1 to 10 and the Excel file is containing numbers within that range so nothing will be let through the "filter".

If you change one or more of the values to be outside the range 1..10 then you will see that it works - and works as expected. At least what I thought you expect from what you told us.

petter
Partner - Champion III
Partner - Champion III

Here are updated attachements