Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ken_Hardwick
Contributor III
Contributor III

Renaming field values in data load

Hello,

I am loading a data field called UserField5 that contains these values - M, C or F. During the data load I would like to rename these values as follows:

  • M to Materials
  • C to Consumables
  • F to Live

What is the best way to achieve this during data load?

Thanks

Labels (1)
  • SaaS

2 Replies
Death4Free
Contributor III
Contributor III

Hi. You can use function Match.

data:
NoConcatenate
Load
	If(Match('M',UserField5),'Materials',
    	If(Match('C',UserField5),'Consumables','Live')) 
        	as new_field;
Load * Inline [
	UserField5
    M
    C
    F
]

 

Kashyap_R
Partner - Specialist
Partner - Specialist

Hi

Try this

 

If(trim(UserField5) = 'M','Materials',
    	If(trim(UserField5)='C','Consumables','Live')) as UserField5;
OR
if you have others
If(trim(UserField5) = 'M','Materials',
    	If(trim(UserField5)='C','Consumables',
              If(trim(UserField5)='F','Live',Others')) as UserField5;

 

replace the UserField5 

if you want it as new column rename the name you want

Hope this helps

Thanks

Thanks and Regards
Kashyap.R