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

Convert to Date

I have "Completion Date" field  which looks like this

7/17/2019 09:06 AM America/New York

I managed to separate date from the text but cannot convert date into date datatype.

Can someone help?

PS - Sorry for the format. Somehow it doesn't allow me to post as is.

Labels (1)
4 Replies
asinha1991
Creator III
Creator III

text to date can be achieved  by date#

date#(textfield, 'format in which text stores date for ex 12/01/2019 could be dd/mm/yyyy')

Vegar
MVP
MVP

@yashkoradia Could you please share an sample on how your Completion Date  could look like

I think you left that part out in your original post.

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

probably this could work:

Subfield(data,' ',1) & ' ' & Subfield(data, ' ',2) & ' ' & Subfield(data, ' ',3)  ---> 7/17/2019 09:06 AM

Subfield(data,' ',1) & ' ' & Subfield(data, ' ',2)  ---> 7/17/2019 09:06

Subfield(data,' ',1) ---> 7/17/2019

asinha1991
Creator III
Creator III

on top of what @StarinieriG suggested , my guess is you will have to add date# if you want field of date type

something like this

 

date#(Subfield(data,' ',1) ,'mm/dd/yyyy') , this will generare date number, add this to format it as date

 

date(date#(Subfield(data,' ',1) ,'mm/dd/yyyy') ,mm/dd/yyyy')