4 Replies Latest reply: Aug 18, 2010 2:18 PM by John Witherspoon RSS

    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!

        • QVD Load with appending daily data
          John Witherspoon

          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.

          • 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


            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

            LOAD distinct *
            resident MySQLTableTMP;

            drop table MySQLTableTMP;
            store MySQLTable into [E:\Qlikview\Data\MySQLTable.qvd];
            drop table MySQLTable ;


            Hope this helps