I have attached a sample workbook with what I think you are looking for. A calculated field was created (bbb) to become the higher level. Hope this helps!
hierarchy in tableau.twbx.zip 10.0 KB
Thanks for your answer.
This will solve my problem but not dynamicaly...
In the sample I would also need the eee to be under the aaa.
In fact, I would need Tableau to use the parentID column but always display the ProductCategoryName