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

Exists Function with 2 parameters

Hi All,

Is it mandatory to have same names for the 2 parameters inside exists function in the below example?

LOAD * INLINE [
ID, NAME
1A, A
2A, B
3A, C
4A, D
5A, E
];
//Load ID , NAM as NAME;

LOAD * INLINE [
ID, NAM
6B, A
7B, B
8B, X
]
where NOT Exists (NAME, NAM)
;

The above query retains the ID value (8B) and somehow removes the NAM value (X) in the resulting table.

 

But, if i use same names inside the parameter of Exists (see below code)by renaming the field NAM as NAME in the 2nd LOAD, both (8B) and (X) are not seen in the result.

 

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

Load ID , NAM as NAME;

LOAD * INLINE [
ID, NAM
6B, A
7B, B
8B, X
]
where NOT Exists (NAME, NAM)
;

Can anyone please tell me if it is a must to have the 2 parameters inside exists function to be the same. Thanks in advance.

 

Kind Regards,

Sharath Panackal

3 Replies
dplr-rn
Partner - Master III
Partner - Master III

not exactly sure what your results are but assuming you want a single table without duplicate values

use below script approach

 

 

 

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

load *
where NOT Exists (NAME)
;
Load ID , NAM as NAME
;
LOAD * INLINE [
ID, NAM
6B, A
7B, B
8B, X
]
;

 

 

 

result

Capture.PNG

 

Brett_Bleess
Former Employee
Former Employee

Sharath, did Dilip's post give you what you needed?  If so, please be sure to circle back and use the Accept as Solution button on his post to give him credit for the help and to let others know it worked.  If you did something different, consider posting that and marking it, and if you are still working on things, leave an update for us.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
rubenmarin

Hi Sarath, I tried both scripts and both versions keeps the '8B' and 'X' values (in the first case 'X' is loaded in the NAM field, not in NAME field)

It's not a must to have both values with the same name in Exists: https://help.qlik.com/en-US/sense/September2018/Subsystems/Hub/Content/Sense_Hub/Scripting/InterReco...

Also, if both parameters have the same name you can use the one-parameter version (like , that allows for optimized load when loading from qvd.