Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

extract a date from a free text field


Hi experts!

I have an 'Update' field loaded in from a SharePoint site that I can't alter, that is a text update.  The users always start their update with the date, then text explaining why the action is late!  I want to be able to show how long since the last update, so I'm looking for a way to extract the first 10 characters of the text (which include the date) and make that into a date field that I can use.

So for example, the 'Update' field might contain:

12/10/2014 - Projects are proposed.  A scheme paper for the first of these is ready for review

I'd like to create a date field called 'LastUpdated' from the 12/10/2014

Any suggestions?

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You can use:

LOAD Update,

DATE#(LEFT(Update,10),'MM/DD/YYYY') AS Date

RESIDENT A;

Or you can find attached sample

Hope helps

Regards,
 
David Sugito

Mobile: + 62 878 0888 9871
Phone: + 62 21 569 823 85 / 86
Email: me@davidshuang.com
Site: www.davidshuang.com

View solution in original post

6 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

if you are sure that the date is always at the start you can use date(left(text,10))

fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try this:

left([Update],10)          as "LastUpdated"

swuehl
MVP
MVP

LOAD

     Date#(Left(Textfield,10),'MM/DD/YYYY') as LastUpdated,

     Textfield,

     ...

FROM ...;

Not applicable
Author

Hi,

You can use:

LOAD Update,

DATE#(LEFT(Update,10),'MM/DD/YYYY') AS Date

RESIDENT A;

Or you can find attached sample

Hope helps

Regards,
 
David Sugito

Mobile: + 62 878 0888 9871
Phone: + 62 21 569 823 85 / 86
Email: me@davidshuang.com
Site: www.davidshuang.com

Not applicable
Author

Thanks David, that was easier than I thought - but then it always is after someone has shown you the way!

Now I've just got to make sure the users keep entering the dates the same!

swuehl
MVP
MVP

Look into the HELP, alt() function and its example on how to parse differently formatted dates in.