Sunday 15 March 2015

Hierarchy vs HierarchyBelongsTo

Recent days I've found a nice video explaining how do 
Hierarchy and HierarchyBelongsTo work 




At a Script Editor just comment/uncomment appropiate pieces of code, e.g.:

TRACE start--Hierarhy;
SLEEP 2000;

Office:
Hierarchy(EmployeeID, ManagerID, Name, MagrName, Name, EmpPathName, '/', Depth)
LOAD * INLINE [
                EmployeeID, Name, ManagerID
                1, George, 0
                2, Sally, 1
                3, Frank, 1
                4, John, 3
                5, Marry, 3
                6, Errol, 2
];             

Transactions:
LOAD * INLINE [
                EmployeeID, Revenue
                1, 600
                2, 500
                3, 400
                4, 300
                5, 200
                6, 100
];


//TRACE start--HierarhyBelongsTo;
//SLEEP 2000;
//
//Office:
//HierarchyBelongsTo(EmployeeID, ManagerID, Name, MgrId, MgrName, Depth)
//LOAD * INLINE [
//              EmployeeID, Name, ManagerID
//              1, George, 0
//              2, Sally, 1
//              3, Frank, 1
//              4, John, 3
//              5, Marry, 3
//              6, Errol, 2
//];           
//
//Transactions:
//LOAD * INLINE [
//              EmployeeID, Revenue
//              1, 600
//              2, 500
//              3, 400
//              4, 300
//              5, 200
//              6, 100
//];
Here you may find HierarchyVSHierarchyBelongsTo.qvw

Enjoy!


Copyright © 2015 Ruslan Goncharov

4 comments: