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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
onchar
Contributor
Contributor

RegEx - tmap

I have a field called Name which I am pulling from Salesforce.  This field is annotated with a date/time stamp which is fine, but in order for me to use that field as a lookup, I need to completely remove the date/time stamp any space(s) in the end of the string.  For example:

the string = somenamehere with spaces2019-10-05 07:01:09

tmap=row3.Name.replaceAll("\\d[:-]*","")

results = somenamehere with spaces

the results above has an extra space - might be hard to see --which I am running out of options on how to get rid of it.

My output file is a txt file with a field separator of a semi colon.

 

Any suggestions folks on how to setup my RegEx?

 

Labels (4)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

(row3.Name.replaceAll("\\d[:-]*","")). replaceAll(" $", "")

View solution in original post

3 Replies
TRF
Champion II
Champion II

(row3.Name.replaceAll("\\d[:-]*","")). replaceAll(" $", "")
TRF
Champion II
Champion II

Did this help?
If so thanks to mark your case as solved.
onchar
Contributor
Contributor
Author

Thank you so much.

 

Your way works better - before i saw this i had everything but . replaceAll(" $", "")

And I was using .trim() which wasn't consistent with some of the names in the file. - Thanks again.