Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am new to Qlikview and have a requirement like below.
Daily I am getting two excel files namely account_inserts and account_updates(these files will be override on daily basis with latest data) which don't have any time stamp columns and having only ID column. Finally I want to combine two files as single as account.QVD.
On daily it should append only current month data only not previous months records.
I know incremental load, but this is something different requirement as I am feeling
Please help me on this issue.
Regards,
Kumar
Maybe (pseudo code)
//Load your updates
LOAD *
FROM [account_updates.xlsx](ooxml, embedded labels, table is Plan1);
If FileSize('yourqvd.qvd') > 0 then
//Load your records that are not updated
LOAD *
FROM [yourqvd](qvd)
WHERE NOT Exists(someKeyField);
endi;f
//Load your inserts
LOAD *
FROM [account_inserts .xlsx](ooxml, embedded labels, table is Plan1);
store table into [yourqvd](qvd);
Maybe (pseudo code)
//Load your updates
LOAD *
FROM [account_updates.xlsx](ooxml, embedded labels, table is Plan1);
If FileSize('yourqvd.qvd') > 0 then
//Load your records that are not updated
LOAD *
FROM [yourqvd](qvd)
WHERE NOT Exists(someKeyField);
endi;f
//Load your inserts
LOAD *
FROM [account_inserts .xlsx](ooxml, embedded labels, table is Plan1);
store table into [yourqvd](qvd);
Hi,
Thanks for providing code.
In this code I have seen qvd file being included. When you do very first time we don't have this file? If I run this code it will throw error.
Regards,
Kumar
You can use Binary load in this scenario else where
Open Qlikview > Edit Script> fetch both file into the edit script> name the tables . concatenate both the tables. and Store it as a QVD . then use windows scheduler to automatically get a qvd for you.
if you want me to guide for window scheduler do let me know.
Hi,
As mentioned, there is no time stamp/date field in the xls files ur receiving, i suggest to save the QVD with a time stamp say temp_23112015.qvd.
and you can manullay(or can define scripts to) deleate or copy the previous month QVDs into a another folder so that only current month QVD files get loaded.
Hope this is usefull
BR, SK
Hi,
You can use only *.xlsx As Filename. This will pick all the files which are in the folder .This Data will append automatically and get updated if the Header are same in all excels and You can use the where condition for month field.
It can be like this,
LOAD *
FROM
[\*.xls]
(biff, embedded labels, table is Sheet1$);
Hope this helps,
regards ,
Hirish
Hi,
Can anyone provide me with example. I tried with excel files overriding and qvd also overriding.
Regards,
Kumar
I´ve updated the code
Thanks clever and it is working fine.
Good to know