Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Lukas_H
Contributor III
Contributor III

Creating a history table for incremental load (updating field with concatenate)

Hi,

i have a script where i basically have 3 functions.

The first one reads every file in the directory and creates a table. I want to use this table to track the files i have already loaded (these are daily files).

Then i have two other functions wich take the files in the directory, decrypt them, load them and then delete every decrypted file in the directory again. In the load statement of these files i create a flag-field wich i want to write in the first table so i know the file is already loaded and qlikview doesn't need to load this file the next day.

My script looks like this:

 

the history table (which reads every file in the directory) has the fields:

ID, PathName, Folder, File_Name, FileExt, Size, FileTime, LoadFlag

and is stored in a qvd which i try to concatenate.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

In the function where i load the actual file i want to update the history taable with the LoadFlag.

 

table1:

LOAD

X,

Y,

Z,

...,

FileBaseName() as CurrFileName,

'LOADED' as LoadFlagFile

FROM

...;

 

Imported_table:

LOAD Distinct
CurrFileName as File_Name,
LoadFlagFile as LoadFlag
RESIDENT table1;

concatenate(Imported_table)
LOAD
*
FROM
[U:\QlikView\TXE_LOADED.qvd]
(qvd);

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

 

Now i just want to update the field LoadFlag in the qvd but every time Qlikview adds a new row where all fields except File_Name & LoadFlag is empty. I just want to concatenate these to tables based on the file name.

I tried concatenate, left join, left keep, droping both tables and creating a new one but nothing worked.

Can anyone help me with this please?

Labels (1)
1 Reply
Brett_Bleess
Former Employee
Former Employee

Lukas, I do not think concatenate is going to work at all in this case, what you are seeing would be the result I would expect there, needs to be a join, including Help link to that area, so you can check details on things there, hopefully that will let you figure out what is wrong with things.

Concatenate Help:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/LoadData/concat...

Join Help:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Scrip...

Design Blog area:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

You can use the last link to search this area for examples/posts related to Joining as well.

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.