Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Append data in a qvd

Hi,

As I am trying a data to be append for a every week, but I don't where I am making a mistake, the script is working fine but I can not find the data on week basis and only I can find the data a for a week only.

Let  vStoreFileName= 'Trend' & WeekDay(Today());

Trend:

Select

         CURDATE() as Date1,

                Week(CURDATE()) as Week1,

         Year(CURDATE()) as Year1,

          Id,

          Id_Name,

          Cutomer_Name,

          Qty,

          Price

From Database;

STORE [Trend] INTO $(vStoreFileName).qvd;

Load * ,' ' as junk resident Trend;

     Concatenate(Trend)

     LOAD * from $(vStoreFileName).qvd;

   

     Store Trend into $(vStoreFileName).qvd;

           

DROP TABLE [Trend];

Regards,

Chriss

Labels (1)
4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I'm not sure what you're trying to do but what the script is doing is this:

1. Create a table Trend and fill it with the data returned from sthe select statement

2. Store Trend into a qvd.

3. Load the data from Trend into another table (not Trend)

4. Load the data from the earlier created qvd and append that to table Trend

5. Store Trend into a qvd again. That qvd has now duplicate data since all the data returned by the select statement was again added to trend by loading the data from the qvd created in step 2.

6. Drop Trend.

You now have only one table created in step 3 with the data returned by the select statement with an extra field called junk.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

Thanks for your reply, the below is the orginal code, I am storing the every day data in qvd in the E:\Test folder, could you please advise me how to append the data for every week.

DIRECTORY E:\Test;

//****************************** Prepare variable for WHERE clause ********************************

Let vid                              = Pick((Num(WeekDay(Today()))+1),'50','2','25','200','500','99999999','99999999');

Let vId_SP                     = Pick((Num(WeekDay(Today()))+1),'50000','12000','25000','20000','50000','99999999','99999999');

Let vStoreFileName           = 'Trend' & WeekDay(Today());

/**************************************************************************************************/

Trend:

SQL SELECT

 

          CURDATE() as Date1,

          Week(CURDATE()) as Week1,

          Year(CURDATE()) as Year1,

           Id,

          Id_SP,

        Id_Name,

        Cutomer_Name,

        Qty,

        Price

FROM Database Where Id IN ($(vid)) AND Id_SP IN ($(vId_SP))

Group by Id,Id_SP,Id_Name,Cutomer_Name,Qty,Price ;

STORE [Trend] INTO $(vStoreFileName).qvd;

Regards

Chriss

er_mohit
Master II
Master II

Not applicable
Author

Hi Gysbert and Mohit,

Thanks a lot for your guidence, the tutorial was really very helpful and now I can strore the data in a qvd weekly basis.

Thanks again..

Regards

Chriss