Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract numeric part

NEED help for following:-

PFA image

My data is in alphanumeric format as shown in attached image below i need to extract only numeric part :-

Please help

9 Replies
maxgro
MVP
MVP

from Qlik inline help

KeepChar(s1 , s2)

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

Example:

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

PurgeChar(s1, s2)

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

Example:

purgechar ( 'a1b2c3','123' ) returns 'abc'

Not applicable
Author

but how cani specify second part data is different in all rows

ychaitanya
Creator III
Creator III

Use KeepChar(FieldName) as Field_Name

This should work


Regards

Chaitanya

ychaitanya
Creator III
Creator III

use purgechar(Fieldname) as String_Data

and

use keepchar(Fieldname) as Numeric_Data

so you will get the values in 2 different fields

ashfaq_haseeb
Champion III
Champion III

Try this

KeepChar(SAP_CODE,'0123456789') as SAP_CODE


Regards

ASHFAQ

Not applicable
Author

yup it worked,,Thanx

ashfaq_haseeb
Champion III
Champion III

Hi,

Can you close this thread by selecting appropriate answers.

Regards

ASHFAQ

Not applicable
Author

Hii Snehal,

Use the following script to keep only numeric data:-

LOAD * INLINE [
    A
    12s
234f
]
;

store S into S.qvd;
drop Table S;

d:

LOAD PurgeChar(A,'sf') as A
FROM
S.qvd
(
qvd);


Thanks & Regards

Prince Anand

maxgro
MVP
MVP

load

     ....,

     KeepChar(yourfield , '0123456789') as newfield

     .....

from

     .....