Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
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

Re: Re: How to rename a field in qlikview

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

11 Replies
venkatasreekant
Valued Contributor

Re: How to rename a field in qlikview

use alias

like

[FieldName] as [NewFieldName]

VishalWaghole
Valued Contributor II

Re: How to rename a field in qlikview

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

Re: How to rename a field in qlikview

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;

venkatasreekant
Valued Contributor

Re: How to rename a field in qlikview

Hi Mandar,

Try this code

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

eduardo_sommer
Valued Contributor

Re: How to rename a field in qlikview

You can use

Rename OldFieldName to NewFieldName;

Eduardo

michael_maeuser
Contributor III

Re: How to rename a field in qlikview

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;

Re: Re: How to rename a field in qlikview

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

Employee
Employee

Re: How to rename a field in qlikview

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;

Sr. Technical Support Engineer with Qlik Support
julian_rodrigue
Valued Contributor

Re: How to rename a field in qlikview

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