Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

shikhakumari18
Contributor

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

Re: How to get the character string only from a word

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
Esteemed Contributor

Re: How to get the character string only from a word

why trim it sunny?

Re: How to get the character string only from a word

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
Esteemed Contributor

Re: How to get the character string only from a word

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..

Community Browser