Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to trim last 10 characters in a filed ?

Hi,

How to trim the last 10 digits from the below data?

Field:

xxxxx1234569878

yyyy1235409876

zzzzzzz6547876534

Expected results:

Filed:

xxxxx

yyyy

zzzzzzz

Thanks

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Left('xxxxx1234569878', Len('xxxxx1234569878')-10) (Generically =Left(Field, Len(Field)-10))

View solution in original post

6 Replies
stigchel
Partner - Master
Partner - Master

Use the Purgechar function e.g.

PurgeChar(Field,'0123456789') as NewField

sunny_talwar

It may be an issue if the first part of thr string contains number also, may be an alternative could be:

=Left('xxxxx1234569878', Len('xxxxx1234569878')-10) (Generically =Left(Field, Len(Field)-10))

Best,

Sunny

Not applicable
Author

Thanks,

But i also have data like

Filed:

3ddd1234786098,

cc56hh3457689087

In this case i want the results as

3ddd

cc56hh

sunny_talwar

Try this:

=Left('xxxxx1234569878', Len('xxxxx1234569878')-10) (Generically =Left(Field, Len(Field)-10))

Not applicable
Author

Thanks alot

sunny_talwar

Not a problem.

Best,

Sunny