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

Prefix column headings

Good morning All,

Can anyone advise how I can prefix column headings with a certain letter or letters in my upload script e.g. if I am prefixing using the letter F, Date would be translated to FDate.

Thank you.

Regards

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi

Apart from Ishfaques answer you could also use the Qualify and UnQualify statements.

These will add the table name to all the fields within that table. Fields that you don'twant to have this prefix will have to be Unqualfied. This might not be what you are looking for. Maybe if you explain why you want to rename or add a prefix we could suggest the best solution for you.

View solution in original post

8 Replies
Not applicable
Author

You Can give the label to the particular column as you want.

Not applicable
Author

Hi Herbert

Can you please provide some live examples so that i can figure out the issue and based upon the comments i will rep you. as you said below comment in you previous one

If i am prefixing using the letter F, Date would be translated to FDate.

But how do you required in your project i mean is that some Text or Label do you required as  prefix. also you can follow the below steps

go to the property and where you title Text is appear you can put the Prefix where ever you required. i have attached the screen for the Caption information where you can add the words

ashfaq_haseeb
Champion III
Champion III

Hi

In script try below

Load

F1,

F2,

Date as FDate;

from test.qvd;

Regards

ASHFAQ

Anonymous
Not applicable
Author

You can define variable as:

SET Add_Prefix='F';

Now in your Script,

Load PART as $(Add_Prefix)PART,

DATE as $(Add_Prefix)DATE,

QTY as $(Add_Prefix)QTY

from table;

engishfaque
Specialist III
Specialist III

Dear Herbert,

Here are the possible ways to rename the fileds.

Method 1: Using AS

--------------------------------

Directory;

LOAD Year13 AS test,

     Year14,

     Sale13,

     Sales14

FROM

[..\..\ExcelSheet\FYear.xlsx]

(ooxml, embedded labels, table is Sheet1);

Method 2: Using Alias

--------------------------------

ALIAS Year13 AS test;

Directory;

LOAD Year13,

     Year14,

     Sale13,

     Sales14

FROM

[..\..\ExcelSheet\FYear.xlsx]

(ooxml, embedded labels, table is Sheet1);

Method 3: Using Rename Field

-------------------------------------------------

Directory;

LOAD Year13,

     Year14,

     Sale13,

     Sales14

FROM

[..\..\ExcelSheet\FYear.xlsx]

(ooxml, embedded labels, table is Sheet1);

RENAME Field Year13 to test;

Kind regards,

Ishfaque Ahmed

Anonymous
Not applicable
Author

Hi

Apart from Ishfaques answer you could also use the Qualify and UnQualify statements.

These will add the table name to all the fields within that table. Fields that you don'twant to have this prefix will have to be Unqualfied. This might not be what you are looking for. Maybe if you explain why you want to rename or add a prefix we could suggest the best solution for you.

MarcoWedel

test data

DateColumn2Column3
01/01/2014ssdfsfdssgdd
01/02/2014fdsfddfgfd
01/03/2014fdsfdsdf
01/04/2014dsgfsdgfdgfd
MarcoWedel

Hi,

one possible generic solution might be also:

QlikCommunity_Thread_130573_Pic1.JPG.jpg

QlikCommunity_Thread_130573_Pic2.JPG.jpg

tabFields:

CrossTable (Field, FieldName)

LOAD 1, *

FROM [http://community.qlik.com/thread/130573]

(html, codepage is 1252, no labels, table is @1)

Where RecNo()=1;

mapFields:

Mapping LOAD

  FieldName,

  'F'&FieldName

Resident tabFields;

DROP Table tabFields;

tabData:

LOAD *

FROM [http://community.qlik.com/thread/130573]

(html, codepage is 1252, embedded labels, table is @1);

RENAME Fields using mapFields;

hope this helps

regards

Marco