Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
pacoli2013
Creator
Creator

Legend and Filter

Hello,

I have a Barchart with 6 expressions and showing the legend. I have a listbox 'Company' with two companies (ECO & ESB).

The expressions are :

2* Sum(Budget): total and product

2* Sum(Sales) for Company 1, divided in products and Batch

2* Sum(Sales) for Company 2, divided in products and Batch

The four sum(sales) are stackt barcharts, the sum(Budgets) are two lines.

The legend shows always  the 6 expressions.

But when I select Company 1, I want to see the expressions belonging to Company 1: the two Budgets and the two Sales.

When I select Company 2, I want to see the expressions belonging to Company 2: the two Budgets and the two Sales

When I select both companies or with no selection I want to see all six.

In the script I created two variables:

     SET vLegendCompany1='=GetPossibleCount(Company)=1';

     SET vLegendCompany2='=GetPossibleCount(Company)=1';

In the Expression tab I activate conditional with vLegendCompany1 for expressions Company 1, and vLegendCompany2 for expressions Company 2.

I have added four Screen shots with the four possible selections and results and a qvw as testdocument

The only result I got, is that when I select both companies or no companies all four Sales expressions disappear  (see: both companies selected.jpg)

I tried a wildmatch, didn't work. Tried an IF-Statement, didn't work. So I'm at the end of my possibilities and hope that there is someone who has an other solution which works in the Chart

Thanks in regard

Court

1 Reply
sunny_talwar

Check the attached.... there are other ways to do this... but this seemed like an easy way because you only had 2 companies.... could there be more companies? I can give you other options or you can look here

Customizable Straight Table