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: 
satishqlik
Creator II
Creator II

date

Hi All,

I have date field with diff date formats

and I've been trying to convert into one standard format.

But not working properly can any one suggest me on this?

LOAD [Call Id],

     Status,

     Odate,

     Date((Alt(

     Date#(Odate,'DD-MMM-YY'),

     Date#(Odate,'YYY-MMM-D'),

     Date#(Odate,'YYYY-MMM-DD'),

     Date#(Odate,'MMM/DD/YYYY'),

     Date#(Odate,'MMM/D/YYYY'),

     Date#(Odate,'YYYY-D-MMM'),

     Date#(Odate,'YYYY-DD-MMM'),

     Date#(Odate,'YY-MMM-DD'),'DD-MMM-YY')))as mynewdate

FROM

<>;

snap.jpg

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

LOAD [Call Id],

    Status,

    Odate,

    Date(Alt(Date(Odate),

    Date#(Odate,'DD-MMM-YY'),

    Date#(Trim(Odate),'M/D/YYYY'),

    Date#(Odate,'YYY-MMM-D'),

    Date#(Odate,'YYYY-MMM-DD'),

    Date#(Odate,'MMM/DD/YYYY'),

    Date#(Odate,'MMM/D/YYYY'),

    Date#(Odate,'YYYY-D-MMM'),

    Date#(Odate,'YYYY-DD-MMM'),

    Date#(Odate,'YY-MMM-DD')), 'DD-MMM-YY') as mynewdate

FROM

[..\..\..\Downloads\data.xlsx]

(ooxml, embedded labels, table is Sheet1);


Capture.PNG

View solution in original post

5 Replies
Chanty4u
MVP
MVP

try this

SET DateFormat='DD-MMM-YY';

LOAD [Call Id],

     Status,

     Odate,  

     Date(Date#(Odate,'YY-MMM-DD'),'DD-MMM-YY')))as mynewdate

satishqlik
Creator II
Creator II
Author

Yes tried but still not working!

Chanty4u
MVP
MVP

den try below

Alt( Date#(Odate,'DD-MMM-YY'),

Date#(Odate,'M/D/YYYY'),

Date#(Odate,'D/M/YYYY'),

Date#(Odate,'YYYYMMDD'),

Date#(Odate,'DD.MM.YYYY'),

Date#(Odate,'YYYY-MM-DD')

) as Odate



or else


date(floor(alt(

Date#(Odate,'DD-MMM-YY'),

Date#(Odate,'M/D/YYYY'),

Date#(Odate,'D/M/YYYY'),

Date#(Odate,'YYYYMMDD'),

Date#(Odate,'DD.MM.YYYY'),

Date#(Odate,'YYYY-MM-DD')

)),  'DD/MM/YYYY') as Odate

sunny_talwar

Try this:

Table:

LOAD [Call Id],

    Status,

    Odate,

    Date(Alt(Date(Odate),

    Date#(Odate,'DD-MMM-YY'),

    Date#(Trim(Odate),'M/D/YYYY'),

    Date#(Odate,'YYY-MMM-D'),

    Date#(Odate,'YYYY-MMM-DD'),

    Date#(Odate,'MMM/DD/YYYY'),

    Date#(Odate,'MMM/D/YYYY'),

    Date#(Odate,'YYYY-D-MMM'),

    Date#(Odate,'YYYY-DD-MMM'),

    Date#(Odate,'YY-MMM-DD')), 'DD-MMM-YY') as mynewdate

FROM

[..\..\..\Downloads\data.xlsx]

(ooxml, embedded labels, table is Sheet1);


Capture.PNG

antoniotiman
Master III
Master III

I think You forgot

DD-MMM-YYYY format in Alt() expression