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: 
Not applicable

SalesPerson Hierarchy


SalesPerson:
LOAD SalesPerson.SalesPersonID,
SalesPerson.ParentEmployeeBusinessEntityID ,
SalesPerson.FullName,
%KEY_SalesPersonID AS SalesPersonID
RESIDENT TempSalesPerson;
DROP TABLE TempSalesPerson;

AdjacentNodes:
LOAD DISTINCT
SalesPerson.SalesPersonID AS NodeID,
SalesPerson.ParentEmployeeBusinessEntityID AS ParentID,
SalesPerson.FullName AS NodeName
RESIDENT SalesPerson;

DROP TABLE TempTerritory;

// create Expanded Nodes table
SalesPersonHierarchy:
Hierarchy (SalesPersonID, ParentID, NodeName, Parent, NodeName, Path, '-')
LOAD DISTINCT
SalesPerson.SalesPersonID AS SalesPersonID,
SalesPerson.ParentEmployeeBusinessEntityID AS ParentID,
SalesPerson.FullName AS NodeName
RESIDENT SalesPerson;

// create ancestors table
SalesPersonyHierarchyBelognsTo:
HierarchyBelongsTo (NodeID,ParentID,NodeName,CategoryTreeID, CategoryTree)
LOAD NodeID,
NodeName,
ParentID
Resident SalesPersonHierarchy;

Error I get:

ERROR:

HIERARCHY parameter NodeName (="NodeName") is not a valid field
SalesPersonHierarchy:
Hierarchy (SalesPersonID, ParentID, NodeName, Parent, NodeName, Path, '-')
LOAD DISTINCT
SalesPerson.SalesPersonID AS SalesPersonID,
SalesPerson.ParentEmployeeBusinessEntityID AS ParentID,
SalesPerson.FullName AS NodeName
RESIDENT SalesPerson

2 Replies
Anonymous
Not applicable
Author

hello uwe,


I'm not sure but is it normal that you got "NodeName" 2 times in your Hierarchy Expression?

=> Hierarchy (SalesPersonID, ParentID, NodeName, Parent, NodeName, Path, '-')

regards,

Arnaud

Not applicable
Author

Actually , i have no clue what I am doing ,, but it tried this with the same error:

// create Expanded Nodes table
SalesPersonHierarchy:
Hierarchy (SalesPersonID, ParentID, NodeName, Parent)
LOAD DISTINCT
SalesPerson.SalesPersonID AS SalesPersonID,
SalesPerson.ParentEmployeeBusinessEntityID AS ParentID,
SalesPerson.FullName AS NodeName
RESIDENT SalesPerson;

// create ancestors table
SalesPersonyHierarchyBelognsTo:
HierarchyBelongsTo (NodeID,ParentID,NodeName,CategoryTreeID, CategoryTree)
LOAD NodeID,
NodeName,
ParentID
Resident SalesPersonHierarchy;