Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
MVP
MVP

Re: Extract numeric part

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

Re: Extract numeric part

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

ychaitanya
Contributor III

Re: Extract numeric part

Use KeepChar(FieldName) as Field_Name

This should work


Regards

Chaitanya

ychaitanya
Contributor III

Re: Extract numeric part

use purgechar(Fieldname) as String_Data

and

use keepchar(Fieldname) as Numeric_Data

so you will get the values in 2 different fields

Re: Extract numeric part

Try this

KeepChar(SAP_CODE,'0123456789') as SAP_CODE


Regards

ASHFAQ

Not applicable

Re: Extract numeric part

yup it worked,,Thanx

Re: Extract numeric part

Hi,

Can you close this thread by selecting appropriate answers.

Regards

ASHFAQ

Not applicable

Re: Extract numeric part

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

MVP
MVP

Re: Extract numeric part

load

     ....,

     KeepChar(yourfield , '0123456789') as newfield

     .....

from

     .....

Community Browser