Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
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
Partner

 

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
Partner

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
Partner

 

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