4 Replies Latest reply: Mar 25, 2013 6:31 AM by Kaushik Solanki RSS

    How to append a QVD data to other QVD?

      Hi,

       

      I need to concatenate a QVD to other QVD based on the month end of "Month_date" column

       

      CurrentData:

      LOAD Id,

                Department,

                Date(Today(),'DD/MM/YYYY') as Month_date

      From Dummy.xlsx(ooxml, embedded labels);

       

      STORE CurrentData into CurrentData.qvd(qvd);

       

      LET vMonth = Date(Today(),'DD/MM/YYYY');

      LET vMonthend= Date(MonthEnd(Today()),'DD/MM/YYYY');

       

      IF '$(vMonth)' =  '$(vMonthend)' then

       

           Concatenate(CurrentData)

       

           LOAD * from HistoricalData.qvd(qvd);

               

      ENDIF;

      DROP Table CurrentData;

       

      But the above Script marked in Red is not working.

       

      Anyone could you help me on this...

        • Re: How to append a QVD data to other QVD?
          Kaushik Solanki

          Hi,

           

               It may not be working cause you may not have HistoricalData.qvd

           

               What error it is giving?

              

          Regards,

          Kaushik Solanki    

          • Re: How to append a QVD data to other QVD?
            Ananth Raj

             

              Hi Kumari

             

            Try this

             

            CurrentData:

            LOAD Id,

                      Department,

                      Date(Today(),'DD/MM/YYYY') as Month_date

            From Dummy.xlsx(ooxml, embedded labels);

             

            STORE CurrentData into CurrentData.qvd(qvd);

             

            LET vMonth = Date(Today(),'DD/MM/YYYY');

            LET vMonthend= Date(MonthEnd(Today()),'DD/MM/YYYY');

             

            IF '$(vMonth)' =  '$(vMonthend)' then

             

            Load * ,' ' as junk resident CurrentData;

                 Concatenate(CurrentData)

             

                 LOAD * from HistoricalData.qvd(qvd);

                     

            ENDIF;

            DROP Table CurrentData;

            drop field junk;

             

            • Re: How to append a QVD data to other QVD?
              Kaushik Solanki

              Hi,

               

                   I am sure you can not see the table CurrentData at all. Am I right?

               

                   If yes then i want to point out something in your script.

               

                   If you look into your script, after concatenating the CurrentData in Historical data, you will need to store the data in to historical again.

               

                   Meaning the data got concatenated in qpplication but not stored in qvd.

               

                   So your script should be like this.

               

                  

              CurrentData:

              LOAD Id,

                        Department,

                        Date(Today(),'DD/MM/YYYY') as Month_date

              From Dummy.xlsx(ooxml, embedded labels);

               

              STORE CurrentData into CurrentData.qvd(qvd);

               

              LET vMonth = Date(Today(),'DD/MM/YYYY');

              LET vMonthend= Date(MonthEnd(Today()),'DD/MM/YYYY');

               

              IF '$(vMonth)' =  '$(vMonthend)' then

               

              Load * ,' ' as junk resident CurrentData;

                   Concatenate(CurrentData)

               

                   LOAD * from HistoricalData.qvd(qvd);

                  

                   Store CurrentData into HistoricalData.Qvd;

                          

              ENDIF;

              DROP Table CurrentData;

               

              Hope this is clear

               

              Regards,

              Kaushik Solanki