Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Replace function

Hi,

I'd like to rename several values in a field through setting an expression on the forefront.


Say, value 'A' to value 'A1', 'B' to value 'B1', 'C' to value 'C1'.


What syntax should be used then?


Thank you in advance,


Larisa


1 Solution

Accepted Solutions
MarcoWedel

Hi,

another solution could be:

QlikCommunity_Thread_179682_Pic1.JPG

hope this helps

regards

Marco

View solution in original post

10 Replies
marcus_sommer

Maybe something like this:

If(match(Field, 'A', 'B', 'C'), Field & '1', Field)

If there are more values which needed to be renamed more complex a mapping-table would be useful.

- Marcus

malini_qlikview
Creator II
Creator II

You can use Replace() function

Anonymous
Not applicable
Author

Do you mean embedded Replace?

Replace(Replace(Field, Value, Value2), Value3, Value4))

Anonymous
Not applicable
Author

I see,

Is embedded Replace a good option?

Replace(Replace(Field, ValueOld1, ValueNew1), ValueOld2, ValueNew2))

malini_qlikview
Creator II
Creator II

=Replace(Field,Field,Field&'1')

Anonymous
Not applicable
Author

Yes, but if A should be renamed to Apple, B to Bright, C to Clever, this approach won't work. I see that I could use a mapping table, but I am searching for a simpler solution.

maxgro
MVP
MVP

pick(wildmatch(Field,'A','B','C', '*'),'A1','B1','C1',Field)

MarcoWedel

Hi,

another solution could be:

QlikCommunity_Thread_179682_Pic1.JPG

hope this helps

regards

Marco

sunilkumarqv
Specialist II
Specialist II

I'd like to rename several values in a field

=Replace(Fieldname,Fieldname,Fieldname&'1')