Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to rename records in a field in script

hi,

record  refer to rows ie., i have field Identifier which is having 5 records  which i has to rename like 2.16.840.1.114416.1.24.132565 as A and so on is it possible

5 Replies
Anonymous
Not applicable
Author

Hi

You can use Mapping..........and ApplyMap  ...

swuehl
MVP
MVP

If you want to rename field names, use AS, ALIAS or RENAME FIELD (please see the help for more details).

But I assume you want to change the field values to other values.

You can either do this using a conditional function in the LOAD statement:

LOAD

     Pick(Match(A,'Value1', ,'Value2','Value3'), 'NewVal1','NewVal2','NewVal3') AS A,

     ...

Or you can also use a MAPPING approach:

MAP:

MAPPING LOAD * INLINE [

Old, New

Value1,NewVal1

Value2,NewVal2

Value3,NewVal3

];

LOAD

     ApplyMap('MAP', A, 'No Mapping found') AS A,

     ...

Anonymous
Not applicable
Author

How many rows do you have in your field ?

If you have limited rows you can use APPLYMAP() or MAPPING LOAD

kamal_sanguri
Specialist
Specialist

Hi,

Try using Autonumber, it will give a unique id to all the rows with the same values in defined fields.

pls see the snippet below:

Capture.PNG

kamal_sanguri
Specialist
Specialist

Forgot to attach the sample app.. which you can refer

!