Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
]

 

Highlighted
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