Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dates comparision not filtering exactly

Please help on Dates and Format which are complicating my days with out any error

Previous Thread:http://community.qlik.com/thread/142685

I need to display past 12 month of data from current date if suppose today is Nov we have Oct data like that created variables in Oct(10/31/2014) to (10/1/2013) data in between above should load and remaining data to be filtered not to load in App.

Accounting Period has 'YYYYMM' based on this created start and end date

SET TimeFormat='h:mm:ss TT';

SET DateFormat='M/D/YYYY';

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
let vstartdate=Date(MonthEnd(MONTHSTART(TODAY())-1),'MM/DD/YYYY');let venddate=Date(AddMonths(MONTHSTART(Today()),-13),'MM/DD/YYYY');

where Monthstart>=date('$(venddate)') and Monthend<=date('$(vstartdate)')<--- here it is not filtering exactliy

//Monthend(date(  right(Date#( AccPrdOGIS,6), 'YYYYMM'))) <=  Monthend( Today())//where Monthstart(date(Date#(right( AccPrdOGIS,6), 'YYYYMM')))  >=Monthstart( addmonths( Today(),-12))
//and
//Monthend(date(  right(Date#( AccPrdOGIS,6), 'YYYYMM'))) <=  Monthend( Today())//where Monthstart>=Date($(venddate),'MM/DD/YYYY')
//and Monthend<=Date($(vstartdate),'MM/DD/YYYY');
//
////where Monthstart>=date#($(venddate),'')
//and Monthstart<=$(vstartdate);

2 Replies
Not applicable
Author

Only Load data based on MonthStart and see the things once.

where Monthstart>=date('$(venddate)') and Monthstart<=date('$(vstartdate)')<---

or let me know how you are deriving MonthStart and MonthEnd columns.

Not applicable
Author

where Monthstart>=date('$(venddate)') and Monthend<=date('$(vstartdate)')

Thanx For solution missed date format now working fine.

Have you done this type of scenario before

Let say for each Financial Period a12 monhs of data in 1- QVD,

Having a.qvd,b.qvd,c.qvd<----2014

same for a.qvd,b.qvd,c.qvd<---2013

same for a.qvd,b.qvd,c.qvd<---2012

Now I need to compare or Load into App while Looping All years

Accounting Period:2014-November need to have 2014-Oct-31 to 2013-Oct-1

Above need to check 2014 & 2013 Folders any Idea and Sugesstions