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

Where not exist in autoconcatenation

Hi qlikss,

I have 2 files in folder. Names of files.

I) daily_ 1.txt

Ii) daily_2.txt

I am loading into qliksense by using  *

Load * from daily_*.txt.

When I load I want to check whether record exist in first table by using id field in tables.

How can I do this when I am loading like this.

 

 

11 Replies
stonecold111
Creator III
Creator III
Author

Small correction

When I refresh at 11.30 am

Final table

1.  100

1.   200

6.    600

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You want the latest id row.  Use "where not exists(id) "  but load the files ordered latest file first.  You can build the list using "for each x in FileList()" or "First 1"  like shown below.  Here's an sample:

Files:
First 1
LOAD
  FilePath() as FilePath,
  FileTime() as FileTime
FROM
daily_*.txt
(fix, utf8, no labels);

Files2:
NoConcatenate
LOAD *
Resident Files
Order By FileTime desc;

Drop Table Files;

For i = 0 to NoOfRows('Files2')
  LET vFile = Peek('FilePath', RecNo(), 'Files2');
  Data:
  LOAD  *
  FROM
  [$(vFile)] (your filespec...
  Where not exists(id)
;

Next i 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com