Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

vchuprina
New Contributor III

Incorrect date presentation

I use following code to load date from file:

LET vDateRAW = subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1);

LET vDateDay = num(subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 2), 00);

LET vDateMonth = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 1), 00);

LET vDateYear = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 3), 0000);

LET vWEEK =$(vDateYear) & $(vDateMonth) & $(vDateDay);

.

.

.

$(vWEEK) AS WEEK_ENDING_DATE

When I add WeekStart Function

WeekStart($(vWEEK)) AS WEEK_ENDING_DATE,

Date column start looking incorrect :

05/24/57069

What should I do to load week start date in correct format (example '20150207')?


4 Replies
MVP
MVP

Re: Incorrect date presentation

What is your SOURCE_DATE format?

vchuprina
New Contributor III

Re: Incorrect date presentation

Data as of: 2/9/2015

leandro_gocosta
New Contributor III

Re: Incorrect date presentation

Which database you use to make the extractions?

I'm asking because my settlement date format masks in sql.

Re: Incorrect date presentation

Hi, this can work:

Temp:

LOAD * Inline [

SOURCE_DATE

2/9/2015

];

LET vDate = Date(Date#(peek('SOURCE_DATE', 0, 'Temp'), 'MM/DD/YYYY'), 'YYYYMMDD');