Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if statement

i have the following case

whereby my DATE field is not probably formatted.

hence i do a transformation on the field.

Makedate(2000+ num(left(DATE,2)), num(mid(DATE,3,2)), num(right(DATE,2)

however i have data that stretches from 1997 to 2000.

so i tried the following withoiut sucess

if(left(DATE,2) < 90,

Makedate(2000+ num(left(DATE,2)), num(mid(DATE,3,2)), num(right(DATE,2),

MakeDate(1900+ num(left(DATE,2)), num(mid(DATE,3,2)),num(right(DATE,2))

)))) as LeveransDatum

please see application attached

help is greatly appreciated

brad

1 Solution

Accepted Solutions
stabben23
Partner - Master
Partner - Master

Hi, try this instead.

date(date#(DATE,'YYMMDD'),'YYYY-MM-DD') as LeveransDatum

//Stabben

View solution in original post

2 Replies
stabben23
Partner - Master
Partner - Master

Hi,

if(left(DATE,2) < 90 will give you the first two, like 19 or 20.

//Stabben

stabben23
Partner - Master
Partner - Master

Hi, try this instead.

date(date#(DATE,'YYMMDD'),'YYYY-MM-DD') as LeveransDatum

//Stabben