Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exists on Subfield or Alias

Hi everyone,

I am trying to use Exists to exclude results that exists in the Excelfile i am loading but doesn´t in the previously loaded SQL tables.

OrderID is the key. However it loads OrderID´s that has not previously been loaded.

I tried to use exsists in the first load to no avail. Happy for any input!

I.e Exists(OrderID) or Exists(Subfield([Master Reference], ., 1) AS OrderID) doesn´t work

 

MAINFILE:

REPLACE LOAD       SubField([Master Reference], ., 1) AS OrderID
  
FROM[Mainfile.xls] ;
FINALFILE:
NoConcatenate LOAD       OrderID
Resident MAINFILE Where Exists(OrderID)
;
DROP Table MAINFILE ;

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Shouldn't your subfield delimiter / second parameter be '.' (enclosed in single quotes)?

Anyway, I think you should use the two parameter version of exists() function:

FINALFILE:
REPLACE LOAD 
      SubField([Master Reference], '.', 1) AS OrderID
  
FROM[Mainfile.xls]where Exists(OrderID, SubField([Master Reference],'.',1))
;

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Shouldn't your subfield delimiter / second parameter be '.' (enclosed in single quotes)?

Anyway, I think you should use the two parameter version of exists() function:

FINALFILE:
REPLACE LOAD 
      SubField([Master Reference], '.', 1) AS OrderID
  
FROM[Mainfile.xls]where Exists(OrderID, SubField([Master Reference],'.',1))
;

Not applicable
Author

Great, that works just like i hoped.I didn´t know about the two parameter version. Thanks!