Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Alt function

Hi ,

I have Date field with different formats:

JAN 1 2018 12:00AM

2018-02-01

2018/03/01

How to convert in one form of date ?

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

Hi here is one document  i have created for this case

Multiple Dates Using Alt

View solution in original post

6 Replies
Chanty4u
MVP
MVP

Hi here is one document  i have created for this case

Multiple Dates Using Alt

Anonymous
Not applicable
Author

Thanks for the document.

But Still for JAN 1 2018 12:00AM , I tried Date(alt(TimeStamp#(FromDate,'MMM DD YYYY hh:mmTT')),'DD-MM-YYYY').

It is not working

Gowtham174
Creator
Creator

Try this

Date:

load *,

date(alt( date#( date1 , 'YYYY-MM-DD' ),

timestamp#(date1,'MMM D YYYY hh:mmTT'),

date#(date1 , 'YYYY/MM/DD' ),'NO' )) as NewDate;

LOAD * inline [date1

JAN 1 2018 12:00AM

2018-02-01

2018/03/01];

Anonymous
Not applicable
Author

Hi,

Code: timestamp#(date1,'MMM D YYYY hh:mmTT') is not working for date format JAN 1 2018 12:00AM

Peter_Cammaert
Partner - Champion III
Partner - Champion III

The script posted by Gowtham works perfectly for the three cases that you posted in your question.

Alt Function thread305239.jpg

The only reason why it wouldn't work for you is maybe because you are using different source data. Can you post an example document with some sample data that isn't getting translated using this Alt() technique?

Peter

Anonymous
Not applicable
Author

there was an extra space in timestamp date format . currently code is working fine

Date:

load *,

date(alt( date#( date1 , 'YYYY-MM-DD' ),

timestamp#(date1,'MMM D YYYY hh:mmTT'),

date#(date1 , 'YYYY/MM/DD' ),'NO' )) as NewDate;