Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Renaming of QlikView fields

Hi Team,

I am trying to rename columns of a table using Mapping function.

I have provided the link for your reference.

Also, I am attaching my QVW and excel file.

Renaming fields in QlikView using Mapping Load | Learn QlikView

Please help me out in solving the same.

I have tried allot but could not find solution for the same

Regards

Priyanka Pandey

Tags (2)
1 Solution

Accepted Solutions
stigchel
Honored Contributor

Re: Renaming of QlikView fields

Hi Priyanka,

The mapping load should be first in order, secondly in your excel with the mapping remove the [ and ] characters.

Script:

Map_Table:

Mapping LOAD Data_Field_Name,

     Display_Field_Name

FROM

[Mapping Names.xls]

(biff, embedded labels, table is Sheet1$);

Rename Fields Using Map_Table;

FieldNameMap:

LOAD [Row ID],

     [Order ID],

     [Order Date],

     [Ship Date],

     [Ship Mode],

     [Customer ID],

     [Customer Name],

     Segment,

     Country,

     City,

     State,

     [Postal Code],

     Region,

     [Product ID],

     Category,

     [Sub-Category],

     [Product Name],

     Sales,

     Quantity,

     Discount,

     Profit

FROM

[Sample - Superstore.xls]

(biff, embedded labels, table is Orders$);

7 Replies
stigchel
Honored Contributor

Re: Renaming of QlikView fields

Hi Priyanka,

The mapping load should be first in order, secondly in your excel with the mapping remove the [ and ] characters.

Script:

Map_Table:

Mapping LOAD Data_Field_Name,

     Display_Field_Name

FROM

[Mapping Names.xls]

(biff, embedded labels, table is Sheet1$);

Rename Fields Using Map_Table;

FieldNameMap:

LOAD [Row ID],

     [Order ID],

     [Order Date],

     [Ship Date],

     [Ship Mode],

     [Customer ID],

     [Customer Name],

     Segment,

     Country,

     City,

     State,

     [Postal Code],

     Region,

     [Product ID],

     Category,

     [Sub-Category],

     [Product Name],

     Sales,

     Quantity,

     Discount,

     Profit

FROM

[Sample - Superstore.xls]

(biff, embedded labels, table is Orders$);

ger_alegria
Contributor

Re: Renaming of QlikView fields

Use Rename Field Function.

First you have to load your mapping table:

Map_Table:

Mapping LOAD Data_Field_Name,

     Display_Field_Name

FROM

[Mapping Names.xls]

(biff, embedded labels, table is Sheet1$);

Rename Fields Using Map_Table;

After this, you can load the table you want to rename fields and you will see the change in fields names.

Not applicable

Re: Renaming of QlikView fields

Hi,

Thank you for your instant reply.

I tried working on your solution but i am facing the same issue.

Below is the script for your reference

Map_Table:

Mapping LOAD Data_Field_Name,

     Display_Field_Name

FROM

[Mapping Names.xls]

(biff, embedded labels, table is Sheet1$);

Rename Fields Using Map_Table;

FieldNameMap:

LOAD [Row ID],

     [Order ID],

     [Order Date],

     [Ship Date],

     [Ship Mode],

     [Customer ID],

     [Customer Name],

     Segment,

     Country,

     City,

     State,

     [Postal Code],

     Region,

     [Product ID],

     Category,

     [Sub-Category],

     [Product Name],

     Sales,

     Quantity,

     Discount,

     Profit

FROM

[..\Sample Store.xlsx]

(ooxml, embedded labels, table is Orders);

Regards

Priyanka

stigchel
Honored Contributor

Re: Renaming of QlikView fields

Have you also replaced the square brackets in the excel file [ and ] ?? Pleas use attached excel file and it should work. Also attached a working example qvw file with sample data (did not have your data file)

Not applicable

Re: Renaming of QlikView fields

Hi,

Thank you for your help.

Your solution really helped me. After removing square brackets([]) the script executed successfully.

Once again Thank you

Regards

Priyanka

Not applicable

Re: Renaming of QlikView fields

Hi,

Thank you for your reply.

Regards

Priyanka

stigchel
Honored Contributor

Re: Renaming of QlikView fields

You're welcome