2 Replies Latest reply: Sep 2, 2011 2:37 AM by BlackRockS RSS

    Incremental loading with two fact tables??

    sushil kumar

      Hi All,


      In my dashboard i have two fact tables... say FACT1 and FACT2.. also there are other dimentions too...



      In both fact table there is time_id by which we can restrict the data...


      My problem is... first i want to load previous 30 days of data to start with and then data from both fact table should be incremented every 4 hour in 30 days data.


      how to make qvd file and store them such that when they are incremented/refreshed successfully i can use them in my dashboard/application.



      Pleas help me out to solve this problem..




        • Re: Incremental loading with two fact tables??



          Does it mean you always just need last 30 days data in your dashboard and then in QVD?



          • Re: Incremental loading with two fact tables??



            I think with some modifications to original fileds that you have and taking care in the date format you can try the below script.



            //First create a snapshot of 30 days data and store in QVD, this step is one time only.



            //Load time_id, ctry,prod from table table1 where time_id>=Today()-30;


            //Store Last30daysTranData into Last30daysTranData.QVD;


            //Please uncomment the above code and comment everyhting else to create a snapshot


            //Once you created the above snapshot, load data from QVD


            //any data beyond 30 days will not be loaded


            Load * from Last30daysTranData.QVD where time_id>=Today()-30;



            //this will append incremental data which is not there in above QVD

            Concatenate (Last30daysTranData)

            Load time_id, ctry,prod from table databasetable where time_id>=Today()-30;


            Store Last30daysTranData into Last30daysTranData.QVD;