Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Trim end of string to get a date - possible?

Hi all,

I have a feeling that this may be easy, but it's friday and my luck is running low today...

How can I trim a string of test with a numberical date at the end to get the date back?

My field is like:

text40664

texttext40634

etc

So the sting is of varying length, but the date should always be the last 5 digits.

Thanks,

Isabel

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand the question. Do you want the string in front of the number characters?

left(MyField, len(MyField)-5)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

date(num#(right(MyField,5)),'YYYY-MM-DD') as MyDate. Change the formatting as you like.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you. May you please advise me on how to group all the text ie, the string minus 5 digits that related to a date?

Thanks,

Isabel

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I don't understand the question. Do you want the string in front of the number characters?

left(MyField, len(MyField)-5)


talk is cheap, supply exceeds demand
Not applicable
Author

Yes, that's what I meant. Thanks for the translation!