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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
CJR
Contributor II
Contributor II

Replacing / Trimming part of a Text String

Hi all,

I'm trying to standardise a text string which currently has a combination of data - some with numbers only and some with numbers and values - and I want to remove any text from text strings so that only values are shown.

For example, the field contains ABC1234, DEF1234 and 5678. The first two should be displayed as 1234 only, and the last one should still show 5678.  

I'd tried using Replace([Job No], 'ABC' , '' ) but I couldn't remove all the different text variants. Is it possible to use a nested replace function (or similar)? Tried a few different approaches but struggled to fix it!

Thanks!

Labels (4)
1 Solution

Accepted Solutions
CJR
Contributor II
Contributor II
Author

Hi, thanks for the reply. I've tried tweaking your suggestion and either of the below seem to work ok for me...!

purgechar([field],'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z')
keepchar([field],'0,1,2,3,4,5,6,7,8,9')

View solution in original post

2 Replies
BrunPierre
Partner - Master II
Partner - Master II

KeepChar([Field Name],0123456789) as [Value Is Numeric]

CJR
Contributor II
Contributor II
Author

Hi, thanks for the reply. I've tried tweaking your suggestion and either of the below seem to work ok for me...!

purgechar([field],'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z')
keepchar([field],'0,1,2,3,4,5,6,7,8,9')