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


Hi Guys,

I have data in my excel as 2015-07-04 00:36 format which is M/D/YYYY h:mm:ss[.fff] TT' but suddenly some data came in excel as Sep 7, 2015 5:19:42 PM format so it is not takinf date values that are in new format. if i try to convert to M/D/YYYY it takes only till old format not taking the new format. How can i handle this?

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Date(Alt(Date#(DateField, 'YYYY-MM-DD hh:mm'), Date#(DateField, 'MMM D, YYYY hh:mm:ss TT'))) as DateField

View solution in original post

10 Replies
Not applicable
Author

Hi,

Try Using Date#() Function

Converting date format

Not applicable
Author

Hi,

go through this.

The Date Function

sunny_talwar

May be this:

Date(Alt(Date#(DateField, 'YYYY-MM-DD hh:mm'), Date#(DateField, 'MMM D, YYYY hh:mm:ss TT'))) as DateField

sasiparupudi1
Master III
Master III

use

alt

alt(timestamp#('07/4/2015 00:36:34.000 AM','M/D/YYYY h:mm:ss[.fff] TT'),timestamp#('Sep 7,2015 5:19:42 PM','MMM DD,YYYY hh:mm:ss TT'))

hth

Sasi

senpradip007
Specialist III
Specialist III

Try like

alt(Timestamp#(Date, 'yyyy-mm-dd hh:mm'), Timestamp#(Date, 'MMM dd, yyyy h:mm:ss TT')) as NewDate

Not applicable
Author

can't it be handled without using alt function?

sasiparupudi1
Master III
Master III

Correct the date format in the source excel file

sunny_talwar

If you don't want to use Alt, you can use If function, but Alt would be an easier route to take

Not applicable
Author

i mean to say, before whatever format date format data used to come in excel it used to convert to M/D/YYYY but this format it is not converting, user wants us to make it dynamic with whatever format they enter