Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

lou_grauss
Not applicable

Rename text within a field

Hi,

Is it possible to search for parts of text and rename them.

For example, my description now looks like this:


ItemDescription
ASoft Blue Adrien
BAdrien Light Tan
CAdrien White/Blue eclipse Nappa/Pu/Nappa
DWhite/Nautical Blue Adrien Nappa/Pu/Patent
EJester - Suede/burning lthr - Logger XS
FLogger XS Dutch blue
GLogger XS- Dutch blue - Suede/burning lthr/suede perf
HIce Blue Logger XS Suede canvas

I want the fields where 'Adrien' is mentioned in the description, to be renamed to 'Adrien'.

And when 'Logger XS is mentioned I want them to be renamed to 'Logger XS'.

ItemDescriptionNew Description
ASoft Blue AdrienAdrien
BAdrien Light TanAdrien
CAdrien White/Blue eclipse Nappa/Pu/NappaAdrien
DWhite/Nautical Blue Adrien Nappa/Pu/PatentAdrien
EJester - Suede/burning lthr - Logger XSLogger XS
FLogger XS Dutch blue Logger XS
GLogger XS- Dutch blue - Suede/burning lthr/suede perfLogger XS
HIce Blue Logger XS Suede canvas

Logger XS

Is this possible?

I tried a formula like this:

aggr(if(left("[Description]",2)='Adrien', 'Logger XS', ''), "[Description]")

But that is not working, I think because the search criterea can be everywhere in the description?

Tags (1)
1 Solution

Accepted Solutions
prabhu0505
Not applicable

Re: Rename text within a field

if(SubStringCount(Description, 'Adrien')>0, 'Adrien', if(SubStringCount(Description, 'Logger XS')>0,'Logger XS'))

8 Replies
swuehl
Not applicable

Re: Rename text within a field

Look into 'Mapping with Wildcards' in Rob's recipe collection

Recipes | Qlikview Cookbook

prabhu0505
Not applicable

Re: Rename text within a field

if(SubStringCount(Description, 'Adrien')>0, 'Adrien', if(SubStringCount(Description, 'Logger XS')>0,'Logger XS'))

Not applicable

Re: Rename text within a field

if(wildmatch(Item,'*Adrein*'),'Adrein',if(wildmatch(Item,'*'Logger XS'*'), 'Logger XS')))

jagan
Not applicable

Re: Rename text within a field

Hi,

Try like this

LOAD

*,

Pick(Wildmatch(Description,'*Adrein*', '*Logger XS*'), 'Adrein', 'Logger XS') AS NewDescription

FROM DataSource;

Regards,

jagan.

ahmar811
Not applicable

Re: Rename text within a field

Used these Condition at load time

if(wildmatch(Description,'*Adrien*'),'Adrien',if(wildmatch(Description,'*Logger XS*'),'Logger XS')) as new_filed

and also used on Dimension condition 

if(wildmatch(Description,'*Adrien*'),'Adrien',if(wildmatch(Description,'*Logger XS*'),'Logger XS'))


hope this can help you

lou_grauss
Not applicable

Re: Rename text within a field

Thanks, it's working good.

lou_grauss
Not applicable

Re: Rename text within a field

Thanks, this is also working good!

lou_grauss
Not applicable

Re: Rename text within a field

Thanks, this is also working good!