Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
suresh1454
Contributor
Contributor

Parent child Relation

Hi 

I am facing issue to get the logic can you please suggest.

I am having data with columns

PARENTID NODENAME NODEID IOBJNM HIEID
00000213 TNB C807000 00000214 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807010 00000215 0COSTCENTER

JBSC5XSNRM5T1Z8E2TUL87

KQB

00000213 TNB C807020 00000216 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807040 00000217 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807133 00000218 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_BLOCK 00000508 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_BODIR 00000005 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_CFO 00000104 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_CHRMN 00000002 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_CIO 00000212 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_COOED 00000071 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_GBS 00000316 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_GCS 00000076 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_HURES 00000191 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_INADT 00000012 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_PROC 00000291 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_PRSDT 00000015 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_RESM 00000173 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_SEC 00000008 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_STAV 00000181 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_SUBSD 00000485 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000001 TNB COR1_VPEVD 00000158 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000212 TNB COR2_OPS 00000219 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000212 TNB COR2_STR 00000213 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000219 TNB COR3_CDOS 00000236 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000219 TNB COR3_CSE 00000229 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000219 TNB COR3_CSM 00000220 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000219 TNB COR3_DG 00000231 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB C807100 00000237 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_CORES 00000238 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_CSS 00000260 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_ECS 00000278 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_ERP 00000247 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_IO 00000254 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_TAN 00000285 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000236 TNB COR4_TNS 00000266 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB

 

Step1: we have to data which is related to NODENAME=TNB COR1_CIO  this is Main Parent in the chain and under this parent related all Nodename  we have to get.

00000001 TNB COR1_CIO 00000212 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB

 

Now Nodeid 212 want to parent id and we have collect the Nodeids of that

PARENTID NODENAME NODEID IOBJNM HIEID
00000212 TNB COR2_OPS 00000219 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB
00000212 TNB COR2_STR 00000213 0HIER_NODE JBSC5XSNRM5T1Z8E2TUL87KQB

for this nodes also we have to find the childs  how we will get to know this are final childs means when IONJNM is 0Costcenter

PARENTID NODENAME NODEID IOBJNM HIEID
00000213 TNB C807000 00000214 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807010 00000215 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807020 00000216 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807040 00000217 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB
00000213 TNB C807133 00000218 0COSTCENTER JBSC5XSNRM5T1Z8E2TUL87KQB

 

Now this are the final childs means we have to collect all this type of Nodes and to store.

Even for 219 search untill all nodes IOBJNM became Ocostcenter.

 

can you please provide code for this logic. Its Little bit urgent in my project.

Labels (1)
2 Replies
ogster1974
Partner - Master II
Partner - Master II

suresh1454
Contributor
Contributor
Author

Thanks for your Prompt reply but i am having small confusion can you please explain to my scenario