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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Split number alone in Alpha numeric string

Dear All

I need a string function which splint integer values in the alpha numeric string

Example   chequeNo 23456 xxxxxxxx bank

from this value i need to split this number alone 23456 as separate field which function i need to use can any one kindly help me

Thanks in Advance

Siraj

1 Solution

Accepted Solutions
jjordaan
Partner - Specialist
Partner - Specialist

Use this in a textbox to verify it

=KeepChar('CHQ DEPOSIT574918   XXXXXXX Bank', 0123456789)

View solution in original post

8 Replies
prieper
Master II
Master II

SUBFIELD(MyField, ' ', 2)     AS MyNumber

HTH Peter

jjordaan
Partner - Specialist
Partner - Specialist

Hi Siraj,

I think that you can use function KeepChar.

It works like this (copied from help file)

KeepChar(s1 , s2)

Returns the string s1 less all characters not contained in string s2.

Example:

keepchar ( 'a1b2c3','123' ) returns '123'

In your case s2 parameter should be like '0123456789

MK_QSL
MVP
MVP

KeepChar(YourFieldName,'0123456789') as YourFieldName

Anonymous
Not applicable
Author

Hi Siraj Ahamed:

KeepChar(Field,'0123456789')  as  NumbersOnly

KeepChar('chequeNo 23456 xxxxxxxx bank','0123456789'  as NumberOnly

NumbersOnly will contain  23456

Good luck

CB.

Anonymous
Not applicable
Author

hi

the keepChar functions provides integer randomly not returning the Cheque number '23456'  of that filed

        This is feild    

CHQ DEPOSIT574918   XXXXXXX Bank
CHQ DEPOSIT681820 XXXXXXX Bank
CHQ DEPOSIT751955 XXXXXXX Bank
CHQ DEPOSIT000364 XXXXXXX Bank

  

I want like this

574918

681820

751955

000364


thanks for your reply.

jjordaan
Partner - Specialist
Partner - Specialist

Use this in a textbox to verify it

=KeepChar('CHQ DEPOSIT574918   XXXXXXX Bank', 0123456789)

Anonymous
Not applicable
Author

Thanks lot

this KeepChar('CHQ DEPOSIT574918   XXXXXXX Bank', 0123456789) work well

Thanks all Great...

R_Woods_UWS
Contributor
Contributor

My alphanumeric string has numbers then alpha chars then number. I want to show only the numbers before the first alpha character - is there a way to do this. Each part of the string can be different lengths.

 

Example text          numeric (keep)          remainder(drop)

1918xxxxxx1            1918                                  xxxxxx1 

873xxxxxxxx34          873                                 xxxxxxxx34