Friday, 3 February 2017

Hierarchy Function In Qlikview



In Qlikview Hierarchy function consists of following parameters:
Hierarchy (NodeID, ParentID, NodeName, [ParentName], [PathSource], [PathName], [PathDelimiter], [Depth]) (loadstatement | selectstatement)
Here is a quick description of each of the parameters:
NodeID - is the name of the field that contains the node id.
ParentID - is the name of the field that contains the node id of the parent node.
NodeName - is the name of the field that contains the name of the node.
ParentName - is a string used to name the new ParentName field. If omitted, this field will not be created.
PathSource - is the name of the field that contains the name of the node used to build the node path. This is an optional parameter. If omitted, NodeName will be used.
PathName - is a string used to name the new Path field, which contains the path from the root to the node. This is an optional  parameter. If omitted, this field will not be created.
PathDelimiter - is a string used as delimiter in the new Path field. This is an optional parameter. If omitted, ‘/’ will be used.
Depth - is a string used to name the new Depth field, which contains the depth of the node in the hierarchy. This is an optional parameter. If omitted, this field will not be created.

Here is an example for Qlikview Hierarchy:
 // made an cooperation organization structure table.

 ORGANIZATION:
LOAD * INLINE [
    ROLE, REPORTINGMANAGER, LEVELOFBUSINESSHEAD
    Trainee, Investment Manager, Marketing Manager
    Junior Consultant, Sales Manager, Marketing Manager
    Consultant, Operation Manager, Marketing Manager
    Senior Consultant, Operation Manager, Marketing Manager
    Investment Manager, Marketing Manager, Domestic Headquarters
    Operations Manager, Marketing Manager, Domestic Headquarters
    Sales Manager, Marketing Manager, Domestic Headquarters
    Marketing Manager, Domestic Headquarters, Board
    Oversea General Manager, Oversea Headquarters, Board
    Domestic Headquarters, CEO, Board
    Oversea Headquarters, CEO, Board

];



// declared the hierarchy as below

TREE_VIEW:

LOAD Distinct ROLE as VALUE, ROLE & '-ROLE' as NODE_ID, REPORTINGMANAGER & '-REPORTINGMANAGER' as PARENT_NODE_ID resident ORGANIZATION;
LOAD Distinct REPORTINGMANAGER as VALUE,REPORTINGMANAGER & '-REPORTINGMANAGER' as NODE_ID, LEVELOFBUSINESSHEAD & '-LEVELOFBUSINESSHEAD' as PARENT_NODE_ID resident ORGANIZATION;
LOAD Distinct LEVELOFBUSINESSHEAD as VALUE,LEVELOFBUSINESSHEAD & '-LEVELOFBUSINESSHEAD' as NODE_ID,  LEVELOFBUSINESSHEAD & '-LEVELOFBUSINESSHEAD' as PARENT_NODE_ID resident ORGANIZATION;


HIERARCHY_TABLE:
Hierarchy(NODE_ID_H,PARENT_NODE_ID_H, ID, PARENT_NAME, NAME, Organization_Structure) load
NODE_ID,
NODE_ID as NODE_ID_H,
PARENT_NODE_ID as PARENT_NODE_ID_H,
VALUE as ID,
VALUE as NAME
resident TREE_VIEW;


//created a list box, in the properties,select the show as tree view check box,the image shows below:





1 comment:

  1. I guess Qlik view is the most trusted data visualisation tool for creating dashboard and end report for users.

    Qlik Rest Api Connection

    ReplyDelete