Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Renaming fields using load all (*)

Hi there,

I am loading data from an excel spreadsheet with multiple columns.

It simplies things if i use the load all (*) statement.

If I use this functionailty, does it prevent me from renaming my fields? and how do I do this?

Many thanks

Rob

E.g.

LOAD



* FROM

[rob data\Management accts\budgets.xlsx]
(
ooxml, embedded labels, table is feb);


1 Solution

Accepted Solutions
Not applicable
Author

Hello Rob

I would do a simple load as follows, followed by a drop field, something like:

TableName:
LOAD *
, COL1 AS COL1_RENAMED
FROM .........xlsx;
DROP FIELD COL1 FROM TableName;


This means you are renaming one of the columns on load, and removing the original column after the load has finished. This is fine if you are thinking of only renaming a few of the fields, if you are thinking of renaming many of them then it makes sense to simply to it all in the load statement (i.e. do a specific load of each field).

Hope it helps a bit.

View solution in original post

2 Replies
Not applicable
Author

Hello Rob

I would do a simple load as follows, followed by a drop field, something like:

TableName:
LOAD *
, COL1 AS COL1_RENAMED
FROM .........xlsx;
DROP FIELD COL1 FROM TableName;


This means you are renaming one of the columns on load, and removing the original column after the load has finished. This is fine if you are thinking of only renaming a few of the fields, if you are thinking of renaming many of them then it makes sense to simply to it all in the load statement (i.e. do a specific load of each field).

Hope it helps a bit.

sparur
Specialist II
Specialist II

Hi, Rob.

For renaming fields you should to use an initial fieldname (column name from Excel) and use "AS" statement.

Example:

LOAD ExcelColumnName AS NewFieldName,

...

FROM ...

or once else you can use a built-in function RENAME.