Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Renaming of fields

I need to rename my existing field Primary Owner to Revised Owner.

I have used the below script before loading the base data but after running it I am still getting the old field name i.e Primary Owner. Can somebody please let me know what is going wrong and why my new field is not being shown?

mapnames:

mapnames:

Mapping load

[Old Name],

    [New Name]

From....

RENAME Fields using mapnames;

LOAD [Primary Owner],

       [Ticket Number]

FROM

(ooxml, embedded labels, table is [base data]);

My Old Name has value [Primary Owner] and [New Name] has value [Actual Name]

After executing the above the table still shows Primary Owner instead Actual Name

1 Solution

Accepted Solutions
el_aprendiz111
Specialist
Specialist

Hi,

1 EXAMPLE:

LOAD * Inline

[

A, B, C, D, E

NB000532, 2186225622, 26/07/2016, 160, XYZ

NB000532, 2770975951, 03/01/2017, 304, DCE

NB000532, 2848419068, 01/03/2018, 118, GRE

NB000532, 3095092593, 29/08/2017, 156, UJM

NB000532, 3447128761, 25/05/2016, 206, TGB

NB000532, 3529363535, 08/07/2017, 388, EFB

NB000532, 4052523136, 16/03/2018, 239, WDV

NB000532, 4053247978, 18/03/2018, 387, WSX

];

Rename_Map:

Mapping

Load * Inline [

old_name, new_name

A, COD

B, VALUE

C, DATE

D, ID

E, NIF

];

RENAME Fields using Rename_Map;

View solution in original post

4 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

You need to use ApplyMap() function with Mapping Load.

Try the below script:

mapnames:

Mapping Load

     [Old Name],

     [New, Name]

From ....

Load

     ApplyMap('mapnames', [Primary Owner], 'N/A')     As [Revised Owner],

     [Ticket Number]

From ....

Hope this helps.

el_aprendiz111
Specialist
Specialist

Hi,

1 EXAMPLE:

LOAD * Inline

[

A, B, C, D, E

NB000532, 2186225622, 26/07/2016, 160, XYZ

NB000532, 2770975951, 03/01/2017, 304, DCE

NB000532, 2848419068, 01/03/2018, 118, GRE

NB000532, 3095092593, 29/08/2017, 156, UJM

NB000532, 3447128761, 25/05/2016, 206, TGB

NB000532, 3529363535, 08/07/2017, 388, EFB

NB000532, 4052523136, 16/03/2018, 239, WDV

NB000532, 4053247978, 18/03/2018, 387, WSX

];

Rename_Map:

Mapping

Load * Inline [

old_name, new_name

A, COD

B, VALUE

C, DATE

D, ID

E, NIF

];

RENAME Fields using Rename_Map;

MarcoWedel

Hi,

use the Rename fieldstatement after your fields are loaded.

If you want to define alias names before fields are loaded, you can use the Alias  statement.

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Thanks Marco..It helped as I was doing the rename before the load. I guess rename is to be done after the initial loading of the data..Would you know of any blog that will help me to rename 2 fields to the same name..i guess currently in qlikview this is not possible but our requirement is of renaming 2 fields with people names to one common name field