Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Regarding Last Year To Date

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

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

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.

View solution in original post

2 Replies
Not applicable
Author

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.

Not applicable
Author

Thanks Oswaldo,it worked 🙂

Kiru