Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Joness
Contributor II
Contributor II

How to prevent non-related bars from disappearing when a field is selected

Hi there. I am trying to achieve a graph, where even when fields are selected, the bars do not disappear, but simply change colors. 

Have attached the image on what I have currently, and what I want, to explain in more details.

I have tried adding under expressions background color:

if(GetSelectedCount(Field1) OR GetSelectedCount(Field2),
if(len(concat(Field2)), RGB(200,150,150), RGB(220, 220, 220)), RGB(195, 140, 150))

However, the unselected bars will still disappear.

Any idea what should i do to get the desired outcome?

Thank you!

Kim 

histogram.JPG

Labels (5)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Use the same set analysis in your calculated dimension as well, like:

=aggr({$<Class=, Student=>}
subfield(class(
$(=_Z_Formula)
, $(=_Z_Bin)), ' <', 1)
, Student)

View solution in original post

4 Replies
tresesco
MVP
MVP

Use set analysis in your main expression/measure, like:

Sum({<FieldOfSelection>} Sales)

and then background color expression like:

=If(FieldOfSelection=FieldOfSelection, <selection color>, < light color>)

Joness
Contributor II
Contributor II
Author

Hi Treseco,

I've tried that but doesn't seem to work.

Have attached my qvw on this graph with sample excel.

Able to guide me on where did I go wrong?

 

Thanks!
Kim

tresesco
MVP
MVP

Use the same set analysis in your calculated dimension as well, like:

=aggr({$<Class=, Student=>}
subfield(class(
$(=_Z_Formula)
, $(=_Z_Bin)), ' <', 1)
, Student)

Joness
Contributor II
Contributor II
Author

Thank you! 

It works!