Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Jothi
Contributor III
Contributor III

Expression based on Parent child relationship for Stacked bar chart

I have a Filter for "Child" on my sheet.

I have 2 charts - one that displays data for the "Child" selected in the filter

I have another stacked bar chart that brings bars, the bars should be the name of all the "Child" whose "Parent" is the value selected in the Child Filter. Below is my sample data model - 

Child Parent
Castle – Business Unit NULL
Castle Media Castle – Business Unit
Castle Solutions Castle – Business Unit
Castle Teleservices Castle – Business Unit
Castle Group Castle – Business Unit
Group Finance Castle Group
Group Human Resources Castle Group
Group Regulatory Affairs Castle Group
Technology, Strategy & Development Castle Group
Treasury & Debt Execution Castle Group

 

I want to write an expression that would select the stacks of the bar chart such that,

Bar expression = All Child, where parent = (child selected in the filter)

 

I am totally new to qlik sense, there might be a straight forward way for this, may be I just dont know it yet. 

Labels (1)
2 Replies
MarcoWedel

Although I agree that creating a hierarchy in this case should be the preferred solution, I just wanted to add that in case you are looking for a solution that only uses direct descendants (i.e. across 1 level), then using a set expression like

 

{$<Child=, Parent=p(Child)>} 

or

{$<Child=, Parent=$::Child>} 

 


might be enough.

 

hope this helps

Marco