Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
You Can give the label to the particular column as you want.
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
Hi
In script try below
Load
F1,
F2,
Date as FDate;
from test.qvd;
Regards
ASHFAQ
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;
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
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.
test data
Date | Column2 | Column3 |
---|---|---|
01/01/2014 | ssdfsfds | sgdd |
01/02/2014 | fds | fddfgfd |
01/03/2014 | fdsfds | df |
01/04/2014 | dsgfsd | gfdgfd |
Hi,
one possible generic solution might be also:
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