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: 
phillosopher
Contributor
Contributor

Non typical format date

Hi All!

How I can convert string with format ('EEE, dd MMM yyyy hh:mm:ss Z') into Date or Timestemp?

Example, 'Fri, 6 Mar 2020 11:45:16 +0300'

Labels (2)
2 Replies
Wlad_Masi
Former Employee
Former Employee

@phillosopher use the date() function
EX: Date(Field, 'MM/DD/YYYY') would return 03/13/2020.

To help users find verified answers, please don't forget to mark a correct resolution or answer to your problem or question as correct.
andrew_smith200
Contributor III
Contributor III

In Qlik Sense you would have to turn your string into some kind of date format it recognises - YYYY-MM-DD hh:mm[:ss[.fff]]

So in your load script something like this

map:
mapping load * INLINE
[
Month, Number
Jan, 01
Feb, 02
Mar, 03
Apr, 04

] (delimiter is ',');


[Data]:
LOAD * INLINE
[
Brand_Weeks,LAST_UNIQUE, Date
47,5, 'Fri, 6 Mar 2020 11:45:16 +0300',
48,20, 'Sat, 7 Mar 2020 11:45:16 +0300'
49,56, 'Sun, 8 Mar 2020 11:45:16 +0300'
50,7Fri, 'Mon, 9 Mar 2020 11:45:16 +0300'
](delimiter is ',');

Final:
load *,

MakeDate(mid(Date,12,4),ApplyMap('map',mid(Date,8,3)), mid(Date,6,2)) as Datenew
Resident Data; drop Table Data;