Discussion board where members can get started with QlikView.
got a Date field YYYYMM in a table, formatted like this in an earlier step/app:
Date(Date#(MyField,'YYYYMM'),'YYYYMM') AS Period
Now, in a second app, I will load this table (with the Period field), and use a where clause that should only load records where Period is less than todays YYYYMM. For example, now we have March 2015 (201503) and then I will only load records less than 201503.
How can I do that? Format and use today() somehow?
Are you saying that you are creating a new application and loading the same table, then you should do as below.
from xyz where Date(Date#(MyField,'YYYYMM'),'YYYYMM') < date(today(),'YYYYMM');
If you are saying that you are doing this in same app, where in first step have already converted this then you should do as below.
Resident (Tablename Which you have loaded earlier)
where Period <
have made an example (see attached file) which contains this code:
LOAD Item, Date(Date#(Period,'YYYYMM'),'YYYYMM') as Period
where Date(Date#(Period,'YYYYMM'),'YYYYMM') < date(today(),'YYYYMM');
The result still shows 201603 (but not 201604 and 201605).
What am I doing wrong?