Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
aishan07
Contributor II
Contributor II

Interactive Legend in Stacked Bar

I have created a stacked bar, with one dimension(Month) and two measures. When I click on the legend at the bottom left(Hourly or Salaried), it doesn't drill down, please suggest a way with code to make legends interactive and drill down upon selecting.

aishanmunshi_0-1595467078046.png

 

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

 

HI 
in that case you can create a dimension with valuelist that has the 2 values and use single expression 

so your chart will look like this 

first dimension : Month 

second dimension : valuelist('Hourly','Salaried')

expression: if( valuelist('Hourly','Salaried')='Hourly',sum(Hourly),Sum(Salaried))

View solution in original post

3 Replies
lironbaram
Partner - Master III
Partner - Master III

HI

the legend is measures , so why do you expect them to drill down , there is no drill down of measures 
what do you mean by drill down , what behavior you are looking for ? 

can you elaborate little more  

aishan07
Contributor II
Contributor II
Author

Hi, the requirement is, when I click on salaried legend, the graph should change to salaried bar and show only salaried ones. 

lironbaram
Partner - Master III
Partner - Master III

 

HI 
in that case you can create a dimension with valuelist that has the 2 values and use single expression 

so your chart will look like this 

first dimension : Month 

second dimension : valuelist('Hourly','Salaried')

expression: if( valuelist('Hourly','Salaried')='Hourly',sum(Hourly),Sum(Salaried))