Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
NavinReddy
Creator II
Creator II

How to get number from the text string

Hi All,

Below text i want to get only " 8259075 "number. please help me

When combination of RISK i have to display number

A wrongful rescission could lead to greater customer expenses incurred and potentially disputes and litigation; all leading to potential regulatory breach and financial loss to the firm. [RISK;8259075;Foreclosure Sales Rescission

Thanks in Advance,

Niranjan

1 Solution

Accepted Solutions
vamsee
Specialist
Specialist

Can you provide a sample of 2 -3 lines of your field and output, as Rudolf's suggestion would work for the example provided.


NUM(IF( WildMatch( YourField, '*RISK*') , keepchar(YourField,'0123456789'), NULL())) as New_Field

View solution in original post

15 Replies
Anonymous
Not applicable

you want only numbers from text, e.g. 8259075?

then use keepchar(yourfield,'012345679')

neelamsaroha157
Specialist II
Specialist II

try - PurgeChar(YourFieldName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')

NavinReddy
Creator II
Creator II
Author

When combination of RISK i have to disply number

NavinReddy
Creator II
Creator II
Author

When combination of RISK i have to display number

Anonymous
Not applicable

maybe

if (match(yourfield,'RISK'),keepchar(yourfield,'012345679'))

NavinReddy
Creator II
Creator II
Author

i got the blank data

Anonymous
Not applicable

sorry,

this is correct; needed wildmatch and wildcards

=if (wildmatch('RISK;8259075;Foreclosure Sales Rescission (due to Chase error)','*RISK*')>0, keepchar('[RISK;8259075;Foreclosure Sales Rescission (due to Chase error)]','0123456789'),-1)

instead the string use Name of your field

NavinReddy
Creator II
Creator II
Author

Sorry,

its actually dynamic data, in the same list i have more than 500 name with same format with different names

Anonymous
Not applicable

500 names in one string? then you should think about dividing These huge number of fata in a string

or 500 names in a field?

if in a field use this in a script:

=if (wildmatch(yourfiled'*RISK*')>0, keepchar(yourfiled,'0123456789'),-1)  as yournewfieldnumber