Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
felcar2013
Partner - Creator III
Partner - Creator III

Change of attribute names of field list

Hi

i want to change the field attributes showed in a field list. This is:

Fieldlist 1 contain field attributes A, B, C

i want to change the A, B, C with names, like : instead of showing A, it shall show Arte, instead of B it shalll show Bengala, C shall be Casa

Is it possible to do this on the user interface? or  how can i do this in the script?

i would be very thankful for ideas,

thanks

felipe

1 Solution

Accepted Solutions
Not applicable

hi felipe,

if you load your data from a database table or you cant use an inline table, think you can do it like this:

Table1:
Load
if(FieldName='A', 'Arte', if(FieldName='B', 'Bengala', if(FieldName='C', 'Casa'))) as NewFieldName
From
TableName;

hope that helps to fix your problem.

regards,

carl

View solution in original post

6 Replies
Not applicable

hi felipe,

if you load your data from a database table or you cant use an inline table, think you can do it like this:

Table1:
Load
if(FieldName='A', 'Arte', if(FieldName='B', 'Bengala', if(FieldName='C', 'Casa'))) as NewFieldName
From
TableName;

hope that helps to fix your problem.

regards,

carl

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks for this, it worked !

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks, when i run the script , it does not recognize my "key" field as you put in your example.

SENCODE:

Mapping LOAD * Inline [
key, name
M, 'monthly'
N, 'never'
Not, 'missing1'
S, 'missing2'
]
;

transaction:

ApplyMap('SENCODE',Key,'missing') as trans_sencode,

what is wrong there?



Not applicable

hi felipe,

first of all, you don't need to use the quotes in your inline table, you can do it like that(only needed if you have somethink like M, 'monthly - test') :

SENCODE:

Mapping LOAD * Inline [
key, name
M, monthly
N, never
Not, missing1
S, missing2
];

in your transaction table you have to use your field from your database table, which you like to map:

transaction:

Load *,

ApplyMap('SENCODE',databaseFieldName,'missing') as trans_sencode,

Field2 as NewField2

From

TableName;

hope that helps you to make your script runable.

regards,

carl

hschultz
Partner - Creator
Partner - Creator

Hi there. I would ecommend rather using Pick+Match oprtion. It loads faster that the IF statement.

This is in your LOAD script:

pick(0+match([FieldName],'A','B','C'),

                    'Arte','Bengala','Casa') AS NewFieldName

felcar2013
Partner - Creator III
Partner - Creator III
Author

thanks  Carl it helped