Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

QVD Load with appending daily data

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!

4 Replies
MVP
MVP

QVD Load with appending daily data

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.

Not applicable

QVD Load with appending daily data

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

Not applicable

QVD Load with appending daily data

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!

MVP
MVP

QVD Load with appending daily data


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.



Community Browser