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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Pierre1
Contributor
Contributor

Automatic creation of key between two tables in load script

Hello,

I am trying to understand how can I add manually a key between two tables in the load script. I have tried to mimic what the wizard do : e.g.

// Start of [train.xml] LOAD statements
label:
LOAD label%Table,
%Key_train_17B52150F604C085 // Key to parent table: reportingExport/train
FROM train.xml (XmlSimple, Table is [reportingExport/train/labels/label]);


train:
LOAD trainIdentifier,
trainFamilyID,
trainTrainGroupVersionName,
trainDescription,
timetablePeriod,
trainLineNumber,
familyNumber,
trainNumber,
idExtension,
trainTrainType,
trainTypeProfile,
trainRemarks,
[trainLineNumber/lineNumberIdentifier] as lineNumberIdentifier,
[trainTrainGroupVersionName/trainGroupVersionIdentifier] as trainGroupVersionIdentifier,
%Key_train_17B52150F604C085 // Key for this table: reportingExport/train
FROM train.xml (XmlSimple, Table is [reportingExport/train]);
// End of [train.xml] LOAD statements

And this works fine, %Key_train_17B52150F604C085 is populated in both tables. However, if I had manually this :

 

sectionRemark:
LOAD trainPathNodeSectionRemark%Table,
%Key_trainPathNode_B23783C177252AE6 // Key to parent table: trainPathNode
FROM trainPath.xml (XmlSimple, Table is [reportingExport/trainPath/trainPathNode/trainPathNodeSectionRemarks/trainPathNodeSectionRemark]);

trainPathNode:
LOAD index,
isFirst,
... //many more lines
%Key_trainPath_B23783C177252BF6 // Key to parent table: reportingExport/trainPath
FROM trainPath.xml (XmlSimple, Table is [reportingExport/trainPath/trainPathNode]);

%Key_trainPath_B23783C177252BF6 is not filled. I have also notice that %Key_trainPath_B23783C177252BF6 hat tags $text and $ascii while %Key_train_17B52150F604C085, introduced by the wizard has tags $numeric and $integer. I wonder what are the difference between the key introduced by the wizard and the one I am trying to define manually.

Thanks in advance for any help

Cheers

Pierre

 

0 Replies