21.01.2013 Views

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

QlikView Reference Manual.pdf - QlikCommunity - QlikView

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

All nodes without a parent id or with a parent id not found in the nodeID column will be considered as<br />

roots. Also, only nodes with a connection to a root node - direct or indirect - will be loaded, thus avoiding<br />

circular references.<br />

Additional fields containing the name of the parent node, the path of the node and the depth of the node can<br />

be created.<br />

The syntax is:<br />

Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource],<br />

[PathName], [PathDelimiter], [Depth])(loadstatement | selectstatement)<br />

where<br />

NodeID is the name of the field that contains the node id.<br />

ParentID is the name of the field that contains the node id of the parent node.<br />

NodeName is the name of the field that contains the name of the node.<br />

ParentName is a string used to name the new ParentName field. If omitted, this field will not be created.<br />

PathSource is the name of the field that contains the name of the node used to build the node path.<br />

Optional parameter. If omitted, NodeName will be used.<br />

PathName is a string used to name the new Path field, which contains the path from the root to the node.<br />

Optional parameter. If omitted, this field will not be created.<br />

PathDelimiter is a string used as delimiter in the new Path field. Optional parameter. If omitted, ‘/’ will be<br />

used.<br />

Depth is a string used to name the new Depth field, which contains the depth of the node in the hierarchy.<br />

Optional parameter. If omitted, this field will not be created.<br />

Example:<br />

Hierarchy(NodeID, ParentID, NodeName) Load<br />

NodeID,<br />

ParentID,<br />

NodeName,<br />

Attribute<br />

From data.xls (biff, embedded labels, table is [Sheet1$];<br />

Back to Script Statements and Keywords (page 219).<br />

HierarchyBelongsTo<br />

The hierarchybelongsto keyword is a prefix to the Load (page 246) and Select (SQL) (page 262) statements.<br />

The internal table must be an adjacent nodes table.<br />

Adjacent nodes tables are tables where each record corresponds to a node and has a field that contains a reference<br />

to the parent node. In such a table the node is stored on one record only but can still have any<br />

number of children. The table may of course contain additional fields describing attributes for the nodes.<br />

More details about adjacent nodes tables and expanded nodes tables can be found in the chapter Hierarchies<br />

in section Evaluating the Loaded Data (page 375).<br />

The prefix creates a table containing all ancestor-child relations of the hierarchy. The ancestor fields can then<br />

be used to select entire trees in the hierarchy. The output table usually contains several records per node.<br />

An additional field containing the depth difference of the nodes can be created.<br />

The syntax is:<br />

237

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!