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

How to get the character string only from a word

Hi,

In my application, one of the field have data like below

 

order_description
No name assigned
011-390-1   sandhay bhoir
011-619-01  XYZ
011-623-01  John ankitson

100-1143-01 Ankit srivastava

How can I achieve this output mentioned below:-

 

order_description
No name assigned
sandhay bhoir
XYZ
John ankitson
Ankit srivastava
4 Replies
sunny_talwar

This might work if you won't have numbers of - in your order_description's second part

Table:

LOAD *,

Trim(PurgeChar(order_description, '0123456789-')) as new_order_description;

LOAD * INLINE [

    order_description

    No name assigned

    011-390-1   sandhay bhoir

    011-619-01  XYZ

    011-623-01  John ankitson

    100-1143-01 Ankit srivastava

];

OmarBenSalem

why trim it sunny?

sunny_talwar

There seems to be two spaces one some occasions.... just trying to get rid of any extra spaces at the beginning and/or at the end

OmarBenSalem

u know, I've always thought that trim works like replace(field,' ','')...

But no, trim does not eliminate all the spaces, but rather the "unwanted" ones..