Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have to filter only for Current 10 weeks data while loading without hard-coding it, but am not aware how would i do that in script level.
looking forward for your help.
Thanks & Regards,
Venkat T
Hi Venkat
Probably the best way would be to do it on database level. Which DBMS are you using? Please post your load statement
Lukasz
Hi
Are you looking for the last 10 weeks (i.e. 70days) or the 10 weeks from last Sunday?
But you can use today() functionality against your dates and/or weeks in your load script. For example;
Load
*
From [FILE]
where today()>= [yourdate] and today()<=[yourdate];
How does this help? Let me know how you get on.
Steve
Sorry - slight amendment to what I wrote above;
Load
*
From [FILE]
where [yourdate] + 70 >= today();
Something like this:
LET vStart = num(today())-70;
SQL select * from mysource
where MyDate > $(vStart) ;
You may need to format the start date parameter value to the date format your database expects.
Try this:
LET vMaxDate = Num('31/12/2013');
LET vMinDate = Num('01/01/2013');
tCal:
LOAD
$(vMinDate) + RowNo() - 1 As Date,
Date($(vMinDate) + RowNo() - 1) As FormalDate,
AutoGenerate ($(vMaxDate) - $(vMinDate) + 1);
Cal:
NoConcatenate
LOAD
Date,
FormalDate
Resident tCal
Where Date >= ($(vMaxDate) - (10*7) + 1);
DROP Table tCal;