Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
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)
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
Partner
Partner

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