3 Replies Latest reply: Jul 5, 2011 7:54 AM by Lifiester RSS

    how to load previous day data

    Sushil Kumar

      Hi All,

       

      i have two tables one is Time_dim and other is manufacturing....

       

      Time_dim has fields:

       

      time_id,

      time_date,

      month,

      year

       

      Manufacturing table has fields:

       

      Time_id,

      abc,

      xyz,

       

      i want to apply the filter on time_id to load only previous day data from manufacturing table and schedule it for every day....

       

      my problem is..how to store the time_id from time_dim table to a variable so that i can aply filter condition to measurement table

       

       

      Thanks

        • Re: how to load previous day data
          Kaushik Solanki

          Hi,

           

             You can try in this way.

           

             Data:

           

             Load

               time_id,

               time_date,

               month,

               year

             From Time_Dim

           

             join(Data)

             Load

               Time_id,

               abc,

               xyz

              From Manufacturing;

           

             Data1:

              Load

               time_id,

               time_date,

               month,

               year

               abc,

               xyz

             Resident Data where time_date = Pre. date

           

             Drop table Data;

           

           

             Here Pre. Date is a calculation for pre.date.

           

          Regards,

          Kaushik Solanki

          • how to load previous day data

            Hi,

            If you've applied the filter in the time_dim table, you can use the Exists() function to apply in manufacturing table.

             

            time_dim:

            time_id,

            time_date,

            month,

            year

             

            manufacturing:

            time_id,

            abc,

            xyz

            where exists(time_id);

             

            In manufacturing, it will only load rows which time_id has been previously loaded in the time_dim table.

             

            Hope it helps.