Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a problem with my script. I have two Tables that have task schedule data which have identical structure. They automatically concatenate which is fine, but I would like to know where to add an explicit command rather than the implicit.
Secondly and most important I need to add a Column called Source. This will be used to identify which data is being used so the user can toggle between both data tables.
the data is very simple for the Source Inline table. I attached the full load script for review.
Source:
LOAD * INLINE [
Source
4.2A
4.2B
];
ExtendedAttribute4.2A:
LOAD FieldID,
FieldName,
Alias,
Guid,
SecondaryPID,
SecondaryGuid,
%Key_Project_59FE1CDD36903AAC // Auto generated Key to parent table: Task_4.2A
FROM [4.2A.xml] (XmlSimple, Table is [Project/ExtendedAttributes/ExtendedAttribute]);
Task_4.2A:
LOAD UID,
ID,
Name,
Active,
Manual,
Type,
IsNull,
CreateDate,
FROM [4.2A.xml] (XmlSimple, Table is [Project/ExtendedAttributes/ExtendedAttribute]);
NoConcatenate
ExtendedAttribute4.2B:
LOAD FieldID,
FieldName,
Alias,
Guid,
SecondaryPID,
SecondaryGuid,
%Key_Project_59FE1CDD36903AAC // Auto generated Key to parent table: Task_4.2B
FROM [4.2B.xml] (XmlSimple, Table is [Project/ExtendedAttributes/ExtendedAttribute]);
Task_4.2B:
LOAD UID,
ID,
Name,
Active,
Manual,
Type,
IsNull,
CreateDate,
FROM [4.2B.xml] (XmlSimple, Table is [Project/ExtendedAttributes/ExtendedAttribute]);
//Left Join (Task_4.2B)
//Load If(Source='4.2B','4.2B','4.2B') as Source
//Resident Source;
//Left Join (Task_4.2A)
//Load If(Source='4.2A','4.2A','4.2A') as Source
//Resident Source;
Try adding it manually to the tables like.
Task_4.2B:
LOAD
'4.2B' AS Source,
UID,
ID,
Name,
Active,
....
FROM [Tasks_4.2B.xml] (XmlSimple, Table is [Project/Tasks/Task]);
As long you do it in both tables they will still concatenate.
Try adding it manually to the tables like.
Task_4.2B:
LOAD
'4.2B' AS Source,
UID,
ID,
Name,
Active,
....
FROM [Tasks_4.2B.xml] (XmlSimple, Table is [Project/Tasks/Task]);
As long you do it in both tables they will still concatenate.
If it is Table Files you are using, you can also use the function FileName() and SubField().
LOAD
...,
SubField(FileName(),'.') AS Source
That did the trick. Thanks!
I like that, that way its more dynamic when adding more, nice!