Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
riyazasma1009
Contributor

Renaming Multiple fields in Qlikview Script

Hi All,

I am loading the below fields in the load script editor:

A,

B,

C,

D,

E

I wish to rename fields A,B,C to Test.

Can anyone please help me with the same.

Thanks,

Asma

3 Replies
Highlighted
qlikdeez
Valued Contributor

Re: Renaming Multiple fields in Qlikview Script

Hi,

Your field names will have to be unique for each table.

Unless you concatenate fields A B & C together and rename as Test.

If they do not belong to the same table:

rename Field A to Test;

or you can use mapname to rename multiple fields - See qlikview help file

If i have not understood your requirement fully please provide further details.

Thanks

Highlighted
MVP
MVP

Re: Renaming Multiple fields in Qlikview Script

If you need to get the sum of the three fields into one field without tracking where the individual values came from you could simply do:

LOAD

     A + B + C AS Test1,   // If they are numbers

     A & ',' & B & ',' & C AS Test2,   // If they are strings

     D,

     E

FROM

     ......;

OR if you need to keep track of the origin field you could use the CROSSTABLE prefix:

CROSSTABLE( OrgField, Test, 2) LOAD

     D,

     E,

     A,

     B,

     C

FROM

     ....;

You will then get a resulting table of:

D, E, A, OrgField, Test

with 3x as many rows as the source but in the OrgField you will have a value of A, B or C depending on which field the value came from.

Highlighted

Re: Renaming Multiple fields in Qlikview Script

If A,B and C columns are from the same table then you cannot have the same field name for all the 3 fields , that's not allowed ..if its from the different table then try like

rename Field A to Test;

rename Field B to Test;

rename Field C to Test;


check this thread

How to Rename Fields

How to rename a field in qlikview