I have problem with how to create a proper hierarchy in qlikview script. Lets say my source date contains a table with all the records (Records table) and a hierarchy table (Records_Hierarchy) which tells that a certain record has a certain ancestor in the same records -table.
Records:
Record_Id
Record_Name
Records_Hierarchy:
Record_Id
Ancestor_Record_Id
The hierarchy can be deeper than two levels (if that is the correct way to say it), or the record might not have any ancestors: