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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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

Labels (1)
1 Reply
Not applicable
Author

Hello,

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