Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Thanks A lot Ronald.
it is exactly what am trying to achieve. Cheers