Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Format - Input

Trying to use this to let QV know the date format but is not working:

Date# (DateField, 'WWW DMMMYY hh:mm:ss tt')

for a field that has:

Fri  1Aug14 01:00:28 pm

Any suggestions ?

7 Replies
reshmakala
Creator III
Creator III

Can you attach the file about what you are using?

Anonymous
Not applicable
Author

I'm doing this on a chart level, not in the script.

reshmakala
Creator III
Creator III

Ok..What is the original data in datefield that you have and what is the format you are trying to achieve form that?

Anonymous
Not applicable
Author

I'd get rid of the Fri and the 2 spaces after it with a string function first, so ending up with an expression something like this.

=  date ( Date# (mid('Fri  1Aug14 01:00:28 pm' , 6 ) , 'DMMMYY hh:mm:ss tt') , 'DD MMM YYYY' )

Not applicable
Author

Hi,

Try Using Timestamp#(DateField, 'WWW DMMMYY hh:mm:ss tt'))
Hope it helps.

Cheers !

reshmakala
Creator III
Creator III

The expression that you have written gives you 01 Aug 2014. Do you need the time too?

MarcoWedel

You could also try

=Date#(Trim(Mid(DateField,4)), 'DMMMYY hh:mm:ss TT')

or

=Timestamp(Date#(Trim(Mid(DateField,4)), 'DMMMYY hh:mm:ss TT'))

to convert it to your default timestamp format

QlikCommunity_Thread_148271_Pic1.JPG

This expression first deletes the Weekday (which is redundant information anyhow) and interprets the result as timestamp.

I used the trim() function because I was not sure about the number of blanks between weekday and day.

hope this helps

regards

Marco