Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find a string into the values

Good afternoon,

I have a field which can take the values:

CAMB

CONT

DSTO

DSTO,CAMB

DSTO,PRC

DSTO,PRC,CAMB

ESTA

ESTA,DSTO

ESTA,DSTO,PRC

PRC

PRC,CAMB

UPGR

UPGR,DSTO

I would like to create a new field which resume that values in only four:

CAMB

CONT

DSTO

REST

For each value of the original field containing the string 'DSTO' the value of the new field must be DSTO, if not for each value containing 'CONT' the value of the new field must be 'CONT', if not idem with CAMB and the rest of casas must be REST.

I think I am looking for a commad how look for the string into the original field taking the values 'true' or 'false', combined with a chain of "if ...then"

What command or function I need to do this?

Thanks in advance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try this:

if(index(MyField,'DSTO'),'DSTO',if(index(MyField,'CONT'),'CONT',if(index(MyField,'CAMB'),'CAMB','REST')))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try this:

if(index(MyField,'DSTO'),'DSTO',if(index(MyField,'CONT'),'CONT',if(index(MyField,'CAMB'),'CAMB','REST')))


talk is cheap, supply exceeds demand
Not applicable
Author

Great thank you