Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
lou_grauss
Contributor II
Contributor II

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?

1 Solution

Accepted Solutions
prabhu0505
Specialist
Specialist

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

View solution in original post

8 Replies
swuehl
MVP
MVP

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

Recipes | Qlikview Cookbook

prabhu0505
Specialist
Specialist

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

View solution in original post

Not applicable

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

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

*,

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

FROM DataSource;

Regards,

jagan.

ahmar811
Creator III
Creator III

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
Contributor II
Contributor II
Author

Thanks, it's working good.

lou_grauss
Contributor II
Contributor II
Author

Thanks, this is also working good!

lou_grauss
Contributor II
Contributor II
Author

Thanks, this is also working good!