I did a bit of searching in existing posts on the topic of using 'Hierarchy' and 'HierarchyBelongsTo' but I couldn't seem to find anything that talking about what the source data needs to look like to use them in scripts.
I have some detailed sales data that contains a complete 5 level hierarchy for each row of sales. Below is an example of the data structure.
|R100||T123||D453||A876||R001|| $ 115.00 |
|R100||T123||D454||A877||R002|| $ 200.00 |
|R100||T123||D455||A875||R003|| $ 324.00 |
|R100||T124||D455||A878||R004|| $ 86.00 |
|R100||T124||D455||A132||R005|| $ 121.00 |
The dashboard that I am working on will be used by the first three levels (regional, territory and district managers) of the hierarchy so I am trying to ensure that when, for example, a territory manager opens the dashboard that all of his or hers district, area and rep sales are shown.
Does anyone know how I can use 'Hierarchy' and 'HierarchyBelongsTo' to achieve a relationship based on the hierarchy level of the user? Any assistance with this would be very much appreciated.