
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Converting date formats to numeric Date "YYYYMM"
Hi,
while writing a incremental load (to just load the last month), there were some problems with the date formats of qlikview functions and the database.
The Date for each set of data is stored in the database as YYYYMM or YYYYMMDD and YYYYMMDD hh:mm.
The Problem is, that the date functions like now(), today() or date() create values, that are sometimes stored differently than they are formatted in the output (f.e. in tables or textfields)
LET vMaxDate= date(today()-30,'YYYYMM');
output= 201507
stored data = 42290
when i tryed to limit a load based on a date, the $(vMaxDate) variable showed f.e. 201507, but internally, it was stored as 42290 and didnt match the "DATE" field in the database, which is formatted ('201507').
How can i convert the output of a date or time function, to show the date as an integer value ?
- Tags:
- qlikview_scripting


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
May be try thies
LET vMaxDate= Text(date(today()-30,'YYYYMM'));

.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It is working as expected, check below script
LET vMaxDate= date(today()-30,'YYYYMM');
LOAD
'$(vMaxDate)' AS MaxDate
AutoGenerate (1);
If not working use Text() to convert it to text.
Regards,
Jagan.
