Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Add a column from inline to two tables with resident load

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;

1 Solution

Accepted Solutions
Employee
Employee

Re: Add a column from inline to two tables with resident load

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.

4 Replies
Employee
Employee

Re: Add a column from inline to two tables with resident load

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.

Employee
Employee

Re: Add a column from inline to two tables with resident load

If it is Table Files you are using, you can also use the function FileName() and SubField().

LOAD

     ...,

     SubField(FileName(),'.') AS Source

Not applicable

Re: Add a column from inline to two tables with resident load

That did the trick. Thanks!

Not applicable

Re: Add a column from inline to two tables with resident load

I like that, that way its more dynamic when adding more, nice!

Community Browser