Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends,
I appreciate your time!
I have a requirement in which I need to load data until last year to date.
Say for example:
If I reload the application today, I need to load data until 22nd august,2013 based on a field called End_Date.
The Format of End_Date is with time stamp: Eg: 20140831T00:00:00
and also how to convert this to date format say: 2014/08/30
I can make use of set analysis in chart to get LYTD but I need to accomplish it in load script.
Kindly let me know.
Thanks so much!
Regards,
Kiru
Hi,
Try with something like this:
LET vLastYear = Date(MakeDate((Year(Today())-1),Month(Today()),Day(Today())),'YYYY/MM/DD');
MyFactTable:
LOAD
*
From MYFile.qvd
where Date(MakeDate(Left(End_Date,4),Mid(End_Date,5,2),Mid(End_Date,7,2)),'YYYY/MM/DD')>='$(vLastYear)';
With MakeDate you can get a date format from your text value (eg. 20140831T00:00:00) and be able to use it in a where condition in script.
Best regards.
Hi,
Try with something like this:
LET vLastYear = Date(MakeDate((Year(Today())-1),Month(Today()),Day(Today())),'YYYY/MM/DD');
MyFactTable:
LOAD
*
From MYFile.qvd
where Date(MakeDate(Left(End_Date,4),Mid(End_Date,5,2),Mid(End_Date,7,2)),'YYYY/MM/DD')>='$(vLastYear)';
With MakeDate you can get a date format from your text value (eg. 20140831T00:00:00) and be able to use it in a where condition in script.
Best regards.
Thanks Oswaldo,it worked 🙂
Kiru