Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
thanks for this, it worked !
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?
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
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
thanks Carl it helped