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: 
Not applicable

Renaming Field Content

Hi,

i have loaded an excel file with multiple fields.

One field is company code with data such as 1, 2, 3, 4, 5

i want to change the values so for example 1=company a, 2= company b , 2-3-4=Other

what code do i need to use for this

thanks

laura

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

If(Code=1,'a',

If(Code=2,'b',

'Others')) as CompanyName

hope this helps

Sunil Chauhan

View solution in original post

3 Replies
SunilChauhan
Champion II
Champion II

If(Code=1,'a',

If(Code=2,'b',

'Others')) as CompanyName

hope this helps

Sunil Chauhan
Not applicable
Author

Try ApplyMap

Kind Regards

Footsie

hic
Former Employee
Former Employee

Applymap is a much, much, much better solution. An if-function works, but is not manageble. You will soon have more than two values that you want to map to strings.

If you do a

MappingTable:

Mapping Load * inline

[From, To

1, company a,

2, company b ,

3,Other

4,Other];

then you can later, inside a Load statement do

Applymap('MappingTable',Code) as CompanyName

See more on  http://community.qlik.com/blogs/qlikviewdesignblog/2012/09/18/one-favorite-function-applymap

HIC