Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tricky exists thing

Hi Qlikviewgurus,

I came across many situations where exists behave weird specially in resident.

Can Someone pls explain me why I am not getting the value in tableB

Ideally,I want is matching record from tablea and tablec(temp tables) should be present in tableB,Since I am dropping the table going forward.

TableA:

LOAD * Inline

[

C1

A

B

C

W

];

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableB:

LOAD C1 as C1_new

RESIDENT TableA

Where Exists(C1_new,C1);

Drop table TableA;

Drop table TableC;

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

TableA:

LOAD * Inline

[

C1

A

B

C

W

];

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableB:

LOAD C1 as C1_new

RESIDENT TableA

Where Exists(C1);

Drop table TableA;

Drop table TableC;

To simplify the code you can also try this.

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableA:

LOAD * Inline

[

C1

A

B

C

W

]where Exists(C1);

Drop table TableC;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

12 Replies
sunny_talwar

Try this:

TableA:

LOAD * Inline

[

C1_new

A

B

C

W

];

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableB:

NoConcatenate

LOAD C1_new

RESIDENT TableA

Where Exists(C1, C1_new);

Drop table TableA;

Drop table TableC;

sunny_talwar

Forgot to add NoConcatenate to TableC... Fixed now and also attaching the sample

Anonymous
Not applicable
Author

Thank you for your instant reply Sunny but its not working.

sunny_talwar

Have you looked at the attached application? What else are you expecting to see as the output?

Anonymous
Not applicable
Author

Thank you sunny.Can you pls post the script here as PE doesnt allow me to open it.

Actually that comment was before attachment.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

TableA:

LOAD * Inline

[

C1

A

B

C

W

];

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableB:

LOAD C1 as C1_new

RESIDENT TableA

Where Exists(C1);

Drop table TableA;

Drop table TableC;

To simplify the code you can also try this.

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

TableA:

LOAD * Inline

[

C1

A

B

C

W

]where Exists(C1);

Drop table TableC;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
vinieme12
Champion III
Champion III

IF you want matching records from TABLE A and TABLE C , why are you using exists??

why not INNER JOIN?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

TableA:

LOAD * Inline

[

C1

A

B

C

W

];

INNER JOIN(TableA)

TableC:

Load * Inline

[

C1,desc

W,hu

A,lo

];

Understanding Join, Keep and Concatenate

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi Kushal, when you are loading TableB, all values of C1 exist on C and A tables, that is because Exists is not working as expected.

Regards!