Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
didierodayo
Partner - Creator III
Partner - Creator III

Backdate qvds during Store

Hello , I am struggling with the scenario below. any idea is appreciated.

I would like to save the query below INTO 10 qvds (SAME CONTENT) representing the last 10 days in the format SalesData_20170610.qvd  and so on up till today.

What would be the best method to achieve this?

SalesData:

load * inline [

Month, Amount

1,6

2,4

3,7

4,3

5,4

6,9

7,5

8,7

9,8

10,6

11,9

12,7

];

STORE SalesData Into C:\temp\SalesData.qvd;

  DROP TABLE SalesData;

Thanks

1 Solution

Accepted Solutions
RonaldDoes
Partner - Creator III
Partner - Creator III

Hi Didier,

Here is an example. We loop through all days from ten days ago until today with "FOR i=Date(Today()-10) to Date(Today())" and store the QVD with our determined filename each time.

SalesData:

load * inline [

Month, Amount

1,6

2,4

3,7

4,3

5,4

6,9

7,5

8,7

9,8

10,6

11,9

12,7

];

FOR i=Date(Today()-10) to Date(Today())

Let vFileName = Date($(i), 'YYYYMMDD');

STORE SalesData Into SalesData_$(vFileName).qvd;

NEXT i

DROP TABLE SalesData;

Hope this helps you.

With kind regards,

Ronald

View solution in original post

2 Replies
RonaldDoes
Partner - Creator III
Partner - Creator III

Hi Didier,

Here is an example. We loop through all days from ten days ago until today with "FOR i=Date(Today()-10) to Date(Today())" and store the QVD with our determined filename each time.

SalesData:

load * inline [

Month, Amount

1,6

2,4

3,7

4,3

5,4

6,9

7,5

8,7

9,8

10,6

11,9

12,7

];

FOR i=Date(Today()-10) to Date(Today())

Let vFileName = Date($(i), 'YYYYMMDD');

STORE SalesData Into SalesData_$(vFileName).qvd;

NEXT i

DROP TABLE SalesData;

Hope this helps you.

With kind regards,

Ronald

didierodayo
Partner - Creator III
Partner - Creator III
Author

Thanks A lot Ronald.

it is exactly what am trying to achieve. Cheers