Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

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$);

View solution in original post

7 Replies
stigchel
Partner - Master
Partner - Master

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
Partner - Creator
Partner - Creator

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
Author

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
Partner - Master
Partner - Master

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
Author

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
Author

Hi,

Thank you for your reply.

Regards

Priyanka

stigchel
Partner - Master
Partner - Master

You're welcome