Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to pick only date from text field

Hi All,

We have a weird scenario where in one field they have entered the date as well as some text alone with date. Example:-

Current Date

8/8/2016

9/8/2016

Request on 10/08/2016

Request on 11/08/2016


appreciate your ideas and tricks on the give scenario.



6 Replies
saimahasan
Partner - Creator III
Partner - Creator III

You can use

KeepChar(Current Date,'0123456789/')

Chanty4u
MVP
MVP

try this

purge:

LOAD * INLINE [

    Current Date

    8/8/2016

    9/8/2016

    Request on 10/08/2016

    Request on 11/08/201

];

LOAD KeepChar ([Current Date],'1234567890/') as new

Resident purge;

keep.PNG

try same 

purge:

LOAD * INLINE [

    Current Date

    8/8/2016

    9/8/2016

    Request on 10/08/2016

    Request on 11/08/201

];

LOAD PurgeChar ([Current Date],'abcdefghijklmnopqRstuvwxyz') as new

Resident purge;

its_anandrjs

You can do this way also

Data:
LOAD * Inline
[
Current Date
8/8/2016
9/8/2016
Request on 10/08/2016
Request on 11/08/2016
]
;

New:
LOAD
*,
Right([Current Date],10) as NewDate
Resident Data;

Regards,

Anand

its_anandrjs

Also you can create the correct date format for the fieldNewDate

Date#( Right([Current Date],10),'MM/DD/YYYY') as NewDate

Regards

Anand

Anonymous
Not applicable
Author

Thank you all for your prompt reply. It seems the keep char is most preferred than purge char but both is good workaround.Thanks for quick reply.

Chanty4u
MVP
MVP

nice please close this thread by making helpful/correct answers