Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
poonam_kulwal
Partner - Creator
Partner - Creator

Load last 10 days data from monthly QVDs

Hi All,

Currently my Model script reads data from most recent 2 months qvds ie total 60 days data.

Now I want my model should load last 10 days data (most recent).

I am looking for

if today is 2nd August then

model should read 8 days data from July qvd (24,25,26,27,28,29,30,31)

and 2 days data from August qvd.(1st, 2nd)

Do you have any idea how to go about this?

Appreciate your help on this.

Thanks & Regards,

Poonam

4 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Poonam,

May be try like this

LOAD

...

FROM....

Where [FieYourDateQVD]>=Date(Today()-10);



Regards,

Andrey

tomasz_tru
Specialist
Specialist

Like Andrey said but I would explicit pass a parameter to the today() function. It is not stated in the documentation what is the default value and it is possible to get LAST RELOAD DATE from 'today()'. 'today(1)' safetly give a date of function call.

Tomasz

rahulpawarb
Specialist III
Specialist III

May be this:

//Load the data from last two months QVDs - Considering we have monthly QVDs

For ii=Num(Month(Today()))-1 to Num(Month(Today()))

TmpData:

LOAD Date,

     Sales

FROM Data_2017_$(ii).QVD(qvd);

NEXT


//Here we will load only 10 days data i.e. 24th July 2017 to 2nd August 2017

NoConcatenate

FinalData:

LOAD *

Resident TmpData

Where Date >= Today()-9;

//Drop the temporary table

DROP TABLE TmpData;

Regards!

Rahul Pawar

poonam_kulwal
Partner - Creator
Partner - Creator
Author

Thanks Andrey!

I am also looking for optimizeing my model reload. Currently it is taking 3 hr to complete reload with 2 months data (60 days). I am reading total 12 qvds.

Not sure adding "where condition" with each load script will increase reloads time or not?