You can force them to be loaded with different names
LOAD Status as Status_DepartmentName1
LOAD Status as Status_DepartmentName2
This way you won't have two fields with the same name.
I hope that this is what you are looking for, if not please clarify and some one might have a solution for you.
Thank you very much for your reply.
I should clarify that I am loading one excel file. And there are two different fields with same name in the same excel file. And the field has nothing to do with 'Departments'. It is just that the data is provided by other departments, not the department I am in.
I try to rename one of the 'Status' field (lets say I rename to 'Status_new') but the result is both 'Status' and 'Status_new' are the same field. So one of the original 'Status' field are ignored.
Hope this would help you understand the data.
The excel load has a bit of magic. If you use the "embedded labels" option, the first column labeled "Status" will be known as "Status". The second column labeled "Status" will be known as "Status1". So a generated LOAD statement, or one you code yourself will look like:
From xxx (biff, embedded labels,,,)
Even though both columns have the heading "Status".
Thanks for your advice.
But my autogenerated script didn't automatically change the second field to 'Status1'.
And when I change it manually, it said it didn't recognise the field.
Here is an example of my excel file:
Sample File.csv 205 bytes
There is no direct way to acheive this.
You can try like with explicit labels
try below code
@1 as Status,
@2 as [ID Number],
@3 as [Full Name],
@4 as [Record Type],
@5 as Status1,
@6 as [Hours Code],
@7 as [Hours Description],
@8 as [A/D Code],
@9 as [A/D Code Description],
@10 as [Date From],
@11 as [Date To],
@12 as [Return To Work],
@13 as Hours
(txt, codepage is 1252, explicit labels, delimiter is ',', msq, filters(
Remove(Row, Pos(Top, 1))