Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SalesPerson Hierarchy

I don' understand how to build a SalesPerson Hierarchy, always go the same error, i think i don't understand what it should be, i tried the following:


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:

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

1 Reply
Not applicable
Author

Hello,

Try placing the tab where you have the "hierarchy" of first.