Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
yashkoradia
New 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
Highlighted
asinha1991
Contributor III

Re: Convert to Date

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')

Partner
Partner

Re: Convert to Date

@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.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Partner
Partner

Re: Convert to Date

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
Contributor III

Re: Convert to Date

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')