Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vchuprina
Specialist
Specialist

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')?


Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
4 Replies
MK_QSL
MVP
MVP

What is your SOURCE_DATE format?

vchuprina
Specialist
Specialist
Author

Data as of: 2/9/2015

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
leandro_gocosta
Contributor III
Contributor III

Which database you use to make the extractions?

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

rubenmarin

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');