Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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);
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.
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.
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.