Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qvqfqlik
Creator
Creator

hierarchical data issue

Need some help with Hierarchy data.

I am able to get the Hierarchial names, but  Iam unable to get the the remaining fields data while still maintaining the hierarchy.

I have used

Hierarchy(ID_2,ID_3,NAME) , with this I am able to get the hierarchy names.

And for other data , I have been writing multiple Hierarchy functions like below

eg:  Hierarchy(ID_2,ID_3,Owner)

Hierarchy(ID_2,ID_3,StartDate)

Hierarchy(ID_2,ID_3,EndDate)

The data Iam getting is correct, but not sure if this an ideal way to write multiple Hierarchies for each fields, and it's also creating Synthetic keys.

Below is the sample data , and required result:

SampleData:

ID_1ID_2ID_3NAMEParentNameNameStartDateOwnerEndDate 
1264814634NULLGrandparent_1NULLStartDate_Grandparent_1Owner_1EndDate_Grandparent_1 
126491463514634Parent-1_OfGrandParent1Grandparent_1StartDateParent-1_OfGrandParent1Owner_2EndDateParent-1_OfGrandParent1 
125481465514634Parent-2_OfGrandParent1Grandparent_1StartDate_Parent-2_OfGrandParent1Owner_3EndDate_Parent-2_OfGrandParent1 
126511465614634Parent-3_OfGrandParent1Grandparent_1StartDate_Parent-3_OfGrandParent1Owner_4EndDate_Parent-3_OfGrandParent1 
126531465814656Child-1_Of_Parent-3_OfGrandParent1Parent-3_OfGrandParent1StartDate_Child-1_Of_Parent-3_OfGrandParent1Owner_5EndDate_Child-1_Of_Parent-3_OfGrandParent1 
126561466114656Child-2_Of_Parent-3_OfGrandParent1Parent-3_OfGrandParent1StartDate_Child-2_Of_Parent-3_OfGrandParent1Owner_6EndDate_Child-2_Of_Parent-3_OfGrandParent1 
126581466314656Child-3_Of_Parent-3_OfGrandParent1Parent-3_OfGrandParent1StartDate_Child-3_Of_Parent-3_OfGrandParent1Owner_7EndDate_Child-3_Of_Parent-3_OfGrandParent1 
126591466414656Child-4_Of_Parent-3_OfGrandParent1Parent-3_OfGrandParent1StartDate_Child-4_Of_Parent-3_OfGrandParent1Owner_8EndDate_Child-4_Of_Parent-3_OfGrandParent1 
126601466514656Child-5_Of_Parent-3_OfGrandParent1Parent-3_OfGrandParent1StartDate_Child-5_Of_Parent-3_OfGrandParent1Owner_9EndDate_Child-5_Of_Parent-3_OfGrandParent1 
         
1318714716NULLGrandparent_2NULLStartDate_Grandparent_2Owner_11EndDate_Grandparent_2 
131881471714716Parent-1_OfGrandParent2Grandparent_2StartDate_Parent-1_OfGrandParent2Owner_12EndDate_Parent-1_OfGrandParent2 
131661473714716Parent-2_OfGrandParent2Grandparent_2StartDate_Parent-2_OfGrandParent2Owner_13EndDate_Parent-2_OfGrandParent2 
131181473814716Parent-3_OfGrandParent2Grandparent_2StartDate_Parent-3_OfGrandParent2Owner_14EndDate_Parent-3_OfGrandParent2 
131271474714738Child-1_Of_Parent-3_OfGrandParent2 Parent-3_OfGrandParent2StartDate_Child-1_Of_Parent-3_OfGrandParent2 Owner_15EndDate_Child-1_Of_Parent-3_OfGrandParent2  

 

Required Result:

Grandparent_1 StartDate_Grandparent_1StartDate_Grandparent_1Owner_1Owner_1EndDate_Grandparent_1EndDate_Grandparent_1
Parent-1_OfGrandParent1Grandparent_1StartDateParent-1_OfGrandParent1StartDate_Grandparent_1Owner_2Owner_1EndDateParent-1_OfGrandParent1EndDate_Grandparent_1
Parent-2_OfGrandParent1Grandparent_1StartDate_Parent-2_OfGrandParent1StartDate_Grandparent_1Owner_3Owner_1EndDate_Parent-2_OfGrandParent1EndDate_Grandparent_1
Parent-3_OfGrandParent1Grandparent_1StartDate_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_4Owner_1EndDate_Parent-3_OfGrandParent1EndDate_Grandparent_1
Child-1_Of_Parent-3_OfGrandParent1Grandparent_1StartDate_Child-1_Of_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_5Owner_1EndDate_Child-1_Of_Parent-3_OfGrandParent1EndDate_Grandparent_1
Child-2_Of_Parent-3_OfGrandParent1Grandparent_1StartDate_Child-2_Of_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_6Owner_1EndDate_Child-2_Of_Parent-3_OfGrandParent1EndDate_Grandparent_1
Child-3_Of_Parent-3_OfGrandParent1Grandparent_1StartDate_Child-3_Of_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_7Owner_1EndDate_Child-3_Of_Parent-3_OfGrandParent1EndDate_Grandparent_1
Child-4_Of_Parent-3_OfGrandParent1Grandparent_1StartDate_Child-4_Of_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_8Owner_1EndDate_Child-4_Of_Parent-3_OfGrandParent1EndDate_Grandparent_1
Child-5_Of_Parent-3_OfGrandParent1Grandparent_1StartDate_Child-5_Of_Parent-3_OfGrandParent1StartDate_Grandparent_1Owner_9Owner_1EndDate_Child-5_Of_Parent-3_OfGrandParent1EndDate_Grandparent_1
        
Grandparent_2Grandparent_2StartDate_Grandparent_2StartDate_Grandparent_2Owner_11Owner_1EndDate_Grandparent_2EndDate_Grandparent_2
Parent-1_OfGrandParent2Grandparent_2StartDate_Parent-1_OfGrandParent2StartDate_Grandparent_2Owner_12Owner_1EndDate_Parent-1_OfGrandParent2EndDate_Grandparent_2
Parent-2_OfGrandParent2Grandparent_2StartDate_Parent-2_OfGrandParent2StartDate_Grandparent_2Owner_13Owner_1EndDate_Parent-2_OfGrandParent2EndDate_Grandparent_2
Parent-3_OfGrandParent2Grandparent_2StartDate_Parent-3_OfGrandParent2StartDate_Grandparent_2Owner_14Owner_1EndDate_Parent-3_OfGrandParent2EndDate_Grandparent_2
Child-1_Of_Parent-3_OfGrandParent2 Grandparent_2StartDate_Child-1_Of_Parent-3_OfGrandParent2 StartDate_Grandparent_2Owner_15Owner_1EndDate_Child-1_Of_Parent-3_OfGrandParent2 EndDate_Grandparent_2

 

 

Labels (2)
1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Find the solution attached with this post.

Hope this is what you need.

 

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Find the solution attached with this post.

Hope this is what you need.

 

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
qvqfqlik
Creator
Creator
Author

thankyou very much for your help!