Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Update a resident table

I have a qvw that loads daily qvd's. I would like for it to just add one day everyday rather than reload the entire period of time. Currently it reloads the last two weeks worth of individual qvd's. I attempted to do an add load, but that didn't work. Any help is appreciated.

4 Replies
sunny_talwar

What is the script you are using right now?

Anonymous
Not applicable
Author

This is a simplified version of it.

FOR i = today()-15 to today()-1

LET FILE_Date = date($(i),'yyyyMMdd');

T1:

LOAD date, A, B, C

FROM QVD1$(FILE_Date).qvd

;

T2

LOAD date, A, B, D

FROM QVD2$(FILE_Date).qvd

;

NEXT i;

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try like this (just some steps that can be easily translated into QV script):

  1. Load History QVD (if it exists)
  2. Pick latest date from history file or set latest date to some "first" date if no history
  3. For vDay = LatestDateFromHistory + 1 to Today()
  4.    Assemble correct file name based on vDay value
  5.    Add records from this QVD to resident table
  6. Next
  7. Store resident table into history QVD

If you don't drop the resident table at the end, you'll have an updated internal table, whether you script runs every day or not (fail safe)

Best,

Peter

Anonymous
Not applicable
Author

How would I do that in the script. Particularly your Step 5. I have been throw right into Qlikview and not very familiar with it. I am looking at just updating the internal table so I don't have to create more QVDs. The daily QVD is created every night for the day just ending so it is always a day behind, then this report runs after the latest QVD has been created. I tried ADD LOAD, but when I ran it, it overwrote the historic data and only added yesterday.