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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

filtering numbers out of a filed

Dear all,

I have a field that contains numbers and one letter only. There is no rule where the letter is positioned inside the string, it could be:

E00115

025W06

008S

and so on.

I'm looking for a way to filter out all numbers from the string and have a new field that contains only the letter.

Any idea?

Thanks for your help!

1 Solution

Accepted Solutions
sunny_talwar

Alternatively, you can also use PurgeChar()

Text(PurgeChar(Upper(FieldName), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')) as FieldName_Number

View solution in original post

4 Replies
sunny_talwar

May be using the KeepChar() function:

Text(KeepChar(FieldName, '1234567890')) as FieldName_Number

sunny_talwar

Alternatively, you can also use PurgeChar()

Text(PurgeChar(Upper(FieldName), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')) as FieldName_Number

alexpanjhc
Specialist
Specialist

PurgeChar(FieldName, '0123456789')

Anonymous
Not applicable
Author

Dear Sunny and Alex,

I try a combination of both options and it works, basically what I did was

Text(KeepChar(FieldName, 'NSWE'))


Which are the letters I want to keep.

Thank you!!!