Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi -
I have historical data that never changes. Currently I load into Qlikview like this:
LOAD record1, record 2, record3,...,recordn, date;
SQL SELECT record1, record 2, record3,...,recordn, date from MySQLTable WHERE record1 = X;
STORE MySQL Table into \file\;
I use this format for several sql select statements. I want to be able to have this data stay in qlikview (or qvd) and then just append one day's data at the end of the day. Can I do this without having to reload all the data? If I do how do I write it and if I don't also how do I write it? Do I have to make another tab or can I keep it in this tab?
I am not even sure I am using the .qvd STORE correctly and for its intended purpose - any thoughts? Thanks!
You're using the store command just fine. Yes, you can do this. It's called "incremental load". If you search for that in the reference manual, you'll find an explanation and script examples.
This is how i would do it
//Declare a variable
let vCurrentDay = DATE((date(Today()) - 1), 'YYYY-MM-DD hh:mm:ss[.fff]');
In your temp table only load data from the previous day
MySQLTableTMP:
SQL SELECT *
FROM MySQLTable
WHERE date >= '$(vCurrentDay)';
store MySQLTableTMP into E:\Qlikview\Data\MySQLTableTMP_$(vToday).qvd;//only if you want to track daily changes
//append data to the existing data
concatenate (MySQLTableTMP) //yesterdays data
LOAD *
FROM E:\Qlikview\Data\MySQLTable.qvd (qvd);// exisitng qvd
MySQLTable:
noconcatenate
LOAD distinct *
resident MySQLTableTMP;
drop table MySQLTableTMP;
store MySQLTable into
drop table MySQLTable ;
Hope this helps
The line
drop table MySQLTable;
at the end of the script just drops the table in qlikview, right? It doesn't drop the table in MySQL?
Thanks!
JulieSIG wrote:drop table MySQLTable;
at the end of the script just drops the table in qlikview, right? It doesn't drop the table in MySQL?
Correct. It does not do anything to the ACTUAL table in your database system.