Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

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
Partner
Partner

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
Partner
Partner

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

Partner
Partner

Thanks A lot Ronald.

it is exactly what am trying to achieve. Cheers