Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Format issue

Hi

My excel sheet date field have different formates of dates are available..so i need to make a proper format.How can achieve  this.

16 Replies
qlikviewwizard
Master II
Master II

Hi All,

I tried with the below script. Not working.

Data:

load *, Date(Alt(Date#(Date, 'DD-MM-YYYY'), Date#(Date, 'MM-DD-YYYY'), Date#(Date, 'YYYY-DD-MM')), 'DD-MM-YYYY') as Date_Format2;

Load * , Date(Date#(Date, 'DD-MM-YYYY'), 'DD-MM-YYYY')  As Date_Format1;

LOAD Date,sales INLINE

[

Date,sales

1/2/2009,400

2/13/2009,5000

2009/15/2,3000

3/17/2009,1

];

sasiparupudi1
Master III
Master III

LOAD Date(Alt (date#(Date, 'MM/DD/YYYY'),date#(Date, 'YYYY/DD/MM'),date#(Date, 'MM/DD/YYYY')),'YYYY-MM-DD') as Date,sales

INLINE

[

Date,sales

1/2/2009,400

2/13/2009,5000

2009/15/2,3000

3/17/2009,1

];

marcus_malinow
Partner - Specialist III
Partner - Specialist III

That'd be because you haven't set up an alt condition for any of your date formats.....

You have formats of DD/MM/YYYY, MM/DD/YYYY and YYYY/DD/MM in your data and have set up conditions for DD-MM-YYYY, etc...

qlikviewwizard
Master II
Master II

Hi Marcus Malinow

I tried Alt function also, but is not working. could you provide the solution? Thanks.

marcus_malinow
Partner - Specialist III
Partner - Specialist III

See the attached

qlikviewwizard
Master II
Master II

Hi Marcus Malinow,

I got it. Many thanks.

qlikviewwizard
Master II
Master II

Hi Karthik,

Did you able to solve, please let us know. Thank you.