Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

daya
New Contributor II

How to convert 0032018 into dd/mm/yyyy

Hi All,

I have data '0032018' in date field and I want it to convert into dd/mm/yyyy like '01/03/2018'

plz help.

 

thank you.

 

1 Solution

Accepted Solutions
dilipranjith
Honored Contributor

Re: How to convert 0032018 into dd/mm/yyyy

always 0 as day?
if so try this approach
=Date(MonthStart(Date#('1'&'0032018','DDMMYYYY')),'DD/MM/YYYY')
return 01/03/2018

in your scrpt
Date(MonthStart(Date#('1'&DATEFIELD'DDMMYYYY')),'DD/MM/YYYY') as NewDateField
8 Replies
dilipranjith
Honored Contributor

Re: How to convert 0032018 into dd/mm/yyyy

What does other date values look like.
Do You always want it as start of the month?
daya
New Contributor II

Re: How to convert 0032018 into dd/mm/yyyy

Yes I want it as start of the month and other date values are also in same format.
dilipranjith
Honored Contributor

Re: How to convert 0032018 into dd/mm/yyyy

always 0 as day?
if so try this approach
=Date(MonthStart(Date#('1'&'0032018','DDMMYYYY')),'DD/MM/YYYY')
return 01/03/2018

in your scrpt
Date(MonthStart(Date#('1'&DATEFIELD'DDMMYYYY')),'DD/MM/YYYY') as NewDateField
dilipranjith
Honored Contributor

Re: How to convert 0032018 into dd/mm/yyyy

basically force a dummy day value (always day 10 in this case) and then use monthstart to move to start of month and then format it
Highlighted
Community Manager
Community Manager

Re: How to convert 0032018 into dd/mm/yyyy

@daya Is this for QlikView or Sense? I would like to move this into the correct product forum. 

Sue Macaluso
jayaramp
New Contributor II

Re: How to convert 0032018 into dd/mm/yyyy

Hi,

 

Believe following is the expression you are looking for.

 

Date(Date#(DateFieldName,'DDMMYYYY'),'DD/MM/YYYY')

 

Thanks!

daya
New Contributor II

Re: How to convert 0032018 into dd/mm/yyyy

This is for Qlik Sense.
daya
New Contributor II

Re: How to convert 0032018 into dd/mm/yyyy

@dilipranjith thanks..it works