Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JRules
Contributor
Contributor

Incremental load from txt file - Hourregistration

Hi everyone,

experience with QlikSense about 3 weeks here. So, here is my problem, hope you can help me.

I have a txt-file called RegistrationHours which is updated every day (new data (from yesterday) and changed data (from the past)).

I have another txt-file called WorkingHours which also is updated every day but only contains data from "today - 2 months" to "today+8 months".

Files have date and employee in common.

I've used Concatenate to combine the 2 sources. I used a master(?) Calendar and made another table for the difference between the RegistrationHours and the WorkingHours on a daily base. See attachement.

I want to store the files as QVD files but I need to also do an incremental load on daily base. Insert and change are allowed but no deleting.

Because of the concatenate and the use of Calendar, I have no clue how to start it. I've read a couple of questions and answers here but I just don't get it. How do I start?

Labels (3)
1 Reply
JordyWegman
Partner - Master
Partner - Master

Hi,

For incremental loads you need a unique key for your table. Meaning that this key only exists once in the whole table. Do you have this? Yes, great! No, please make this first.

We'll get back to the updated records, but first the incremental. You can try the following script:

let vToday = Floor(Today()-1)

OldRestigrationHours:
Load
 Key
From [YourSource]
;

RegistrationHours:
Load
  *
From [YourSource]
Where not exists (Key)

Store RegistrationHours in [YourSource/RegistrationHours_$(vToday)](qvd);

What you are doing here is getting the information from yesterday, then get the files from today and see if there are any new records. This is then stored as today containing the new records.

See if you can get this to work. Then we can continue with the rest.

Jordy

Climber

Work smarter, not harder