Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nima94
Contributor III
Contributor III

rename many batch of Code by first Alphabet

hi every one

 

i have filed which contains of many codes and codes are stating with an alphabet

and each alphabet represents category

for example if my code is : A1234 it means it bongs to "APPLE" category

so now as bellow i want to rename all of the cods as bellow:

 

OLD_CODENEW_CODE
A1234Apple
A1235Apple
A1236Apple
A1237Apple
A1238Apple
A1239Apple
A****Apple
  
B1234BIG
B1235BIG
B1236BIG
B****BIG
  
C1234Cat
C1235Cat
C1236Cat
C1237Cat
C****Cat
  
D****Doll
E****Egg

 

can some one please help me to reach to the "NEW_CODE" ?:

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

Pick(Match( Left(OLD_CODE, 1), 'A', 'B', 'C', 'D', 'E'), 'Apple', 'Big', 'Cat', 'Dog', 'Egg')      as     NEW_CODE 

And if you have many such codes, you may try with Applymap()MapSubString()

View solution in original post

2 Replies
tresesco
MVP
MVP

May be like:

Pick(Match( Left(OLD_CODE, 1), 'A', 'B', 'C', 'D', 'E'), 'Apple', 'Big', 'Cat', 'Dog', 'Egg')      as     NEW_CODE 

And if you have many such codes, you may try with Applymap()MapSubString()

nima94
Contributor III
Contributor III
Author

Thanks it works