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

How to rename a field in qlikview

plz help me out with different ways to rename a field or to rename a column name of Inline table with a sample code.

regards,

Mandar

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Syntax would be

RENAME FIELD OldFieldName TO NewFieldName;

RENAME FIELDS OldName1 TO NewName1, OldName2 TO NewName2, OldName3 TO NewName3;

And my favorite:

FieldNamesMap:

MAPPING LOAD OldName,

NewName

FROM File.qvd (qvd);

RENAME FIELDS USING FieldNamesMap;

Miguel

View solution in original post

11 Replies
Anonymous
Not applicable
Author

use alias

like

[FieldName] as [NewFieldName]

VishalWaghole
Specialist II
Specialist II

Hi mandar,

Try this

Temp:

Load * Inline [

Month, Sales

Jun, 123

Jul, 234

Aug, 432

];

Load      Month as MonthName,

             Sales as SalesAmount

Resident Temp;

-- Regards,

Vishal Waghole

its_anandrjs

In inline table you can rename a field with different approach

Ex:-

Load Field1 as Customers ,Field2 as Sales; //By this line as preceding load you can rename

Load * Inline

[

Field1,Field2

A,100

B,200

C,300

D,400

];

Ex:- Or by any resident load you can rename the field

Tab1:

Load * Inline

[

Field1,Field2

A,100

B,200

C,300

D,400

];

NewTable:

Load

Field1 as Customers ,

Field2 as Sales

Resident Tab1;

Drop Table Tab1;

Anonymous
Not applicable
Author

Hi Mandar,

Try this code

Load MonthID as DateID,Month inline [
MonthID,Month
1,Jan
2,Feb
]
;

eduardo_sommer
Partner - Specialist
Partner - Specialist

You can use

Rename OldFieldName to NewFieldName;

Eduardo

michael_maeuser
Partner Ambassador
Partner Ambassador

you can also have a list in e.g. an excel looking like that

original name, new name

...,...

...

and at the end of the script you can do like that

rename fields using excelfile.xlsx;

Miguel_Angel_Baeyens

Syntax would be

RENAME FIELD OldFieldName TO NewFieldName;

RENAME FIELDS OldName1 TO NewName1, OldName2 TO NewName2, OldName3 TO NewName3;

And my favorite:

FieldNamesMap:

MAPPING LOAD OldName,

NewName

FROM File.qvd (qvd);

RENAME FIELDS USING FieldNamesMap;

Miguel

Chip_Matejowsky
Support
Support

Hey Mandar,

Be sure to use the Qlik Sense Help. Below is the entry for Rename Field.

Rename field

This script function renames one or more existing Qlik Sense field(s) after they have been loaded.

Either syntax: rename field or rename fields can be used.

Syntax:

Rename Field (using mapname | oldname to newname{ , oldname to newname })

Rename Fields (using mapname | oldname to newname{ , oldname to newname })

Arguments:

ArgumentDescription
mapnameThe name of a previously loaded mapping table containing one or more pairs of old and new field names.
oldnameThe old field name.
newnameThe new field name.

Limitations:

Two differently named fields cannot be renamed to having the same name. The script will run without errors, but the second field will not be renamed.

Example 1:

Rename Field XAZ0007 to Sales;

Example 2:

FieldMap:

Mapping SQL Select oldnames, newnames from datadictionary;

Rename Fields using FieldMap;

Principal Technical Support Engineer with Qlik Support
Help users find answers! Don't forget to mark a solution that worked for you!
julian_rodriguez
Partner - Specialist
Partner - Specialist

Hola Miguel

Las dos opciones sugeridas me funcionan bien, tanto para renombrar campos como para mantener el vínculo entre los objetos de presentación con los campos renombrados.

Esto, claro está, si lo hago en un documento de prueba.

Pero, sucede que tengo un documento con 600+ campos, y al renombrarlos con cualquiera de las opciones descritas, los objetos quedan desvinculados al campo nuevo y debo volver a asignarlos, bien sea uno por uno, o por el diálogo "Vista prievia de la Expresión (Ctrl+Alt+E)".

Existe un límite en el número de campos que se puedden renombrar sin que se pierda el enlace entre el objeto/expresión/variable que lo contiene, para que Qlikview lo reemplace de manera automática?

Debo entonces cambiar todo manualmente?

Gracias por tus comentarios