Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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;