Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
If(Code=1,'a',
If(Code=2,'b',
'Others')) as CompanyName
hope this helps
If(Code=1,'a',
If(Code=2,'b',
'Others')) as CompanyName
hope this helps
Try ApplyMap
Kind Regards
Footsie
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