Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hierarchy or Self join

Friends:

I have the following table

Dept_id,Dept_name,Parent_id,address,customer

In this table Ancestor records are the one where Parent_Id = 0

so if i write a sql statement, to get the ancestor record

select dept_id,dept_name,address,customer  where Parent_Id =0

for e.g. the ouput of this query can be dept_id =101 and dept_name = commercial

now child records are also in the same table where Parent_id = 101

so the sql statement to get to the child records will be

select dept_id,dept_name where Parent_Id =101

output of this statement will be the children belonging to Parent_id 101. 

How do i achieve this in QV where if user select a parent , he should get all the children belonging to the parent with attributes like address and customer.

if a parent does not have a child then attributes of Parent should be displayed.

Please help.

Thanks.

1 Reply
Not applicable
Author

any suggestions ?