Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Date conversion

Hello,

I have two field, the first [delivery year]

(2015) and the second [month/day delivery] (313) as follow

delivery yearmonth/day delivery
2015313
2015314
2015314
2015316

How can I load in the script a complete date filed with the format 'DD/MM/YYYY'

Thank you

Best regards.

Andrea

1 Solution

Accepted Solutions
Highlighted
Not applicable

Hi Andrea,

please see attached, can use the below to give you this

Date(Date#([delivery year] & If(len([month/day delivery])<4, 0 & [month/day delivery], [month/day delivery]),'YYYYMMDD'),'DD/MM/YYYY') As date

hope that helps

Joe

View solution in original post

8 Replies
Highlighted
Master III
Master III

Hi,

Date(Your_Date_Field,'DD/MM/YYYY') as Date

Thanks,

AS

Highlighted
Not applicable

Try like below,


date(makedate([delivery year],left([month/day delivery],1),right([month/day delivery],2)),'DD/MM/YYYY') as date

Highlighted
Specialist III
Specialist III

Try like

MakeDate([delivery year], left([month/day delivery], 1), right([month/day delivery], 2)) as Date

Highlighted
Contributor III
Contributor III

Thank you All and thank you Harshal,

your expression works properly, but I have seen that the field [month/day delivery] could be also with 4 digits and not only 3,

eg. 03 november as 1103

       03 march       as   303

How can I manage this difference?

Thanks!!

Highlighted
Not applicable

Hi,

you need to create separate fields like below,

if(len([month/day delivery])>3,left([month/day delivery],2),left([month/day delivery],1)) as [Month_month/day delivery]


&


right([month/day delivery],2) as [Day_month/day delivery]


Then create,


New_TBL:

Load

date(makedate(YearField,[Month_month/day delivery],[Day_month/day delivery]),'DD/MM/YYYY') as Date

resident Old_Table;




Highlighted
Not applicable

Hi Andrea,

please see attached, can use the below to give you this

Date(Date#([delivery year] & If(len([month/day delivery])<4, 0 & [month/day delivery], [month/day delivery]),'YYYYMMDD'),'DD/MM/YYYY') As date

hope that helps

Joe

View solution in original post

Highlighted
Contributor III
Contributor III

Thank you Joe!

Highlighted
Not applicable

no worries glad to help