Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
pavanqlik
Contributor II
Contributor II

Issue with date format, i have date field with format 5/12/2015 as string and 20150205 as number need to convert it to MM/DD/YYYY format

Hi,

   I had a date field with some rows in excel

  1)  1-8 it shows as string M/DD/YYYY

  2)   9-10 it shows as text YYYYMMDD



Could you please help me in converting this into  'MM/DD/YYYY' format.



Thanks,

Pavan

2 Replies
qlikmsg4u
Specialist
Specialist

Try this

Load *,Date(Alt(Date#(Date,'MM/DD/YYYY'),Date#(Date,'YYYYMMDD')),'MM/DD/YYYY') as Date1;

LOAD * INLINE [

    Date

    01/01/2016

    01/02/2016

    01/03/2016

    01/04/2016

    01/05/2016

    20160106

    20160107

    20160108

    20160109

    20160110

];

Not applicable

Try this

In load script,

Date(Alt(Date#(datefield,'M/DD/YYYY'),Date#(datefield,'YYYYMMDD'),'MM/DD/YYYY' ))  As newdate

Hope this helps.