Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
stevelord
Specialist
Specialist

Make one chart responsive to all but one list box/field selection

Hi,

Here's the short version of the explanation: I want one of my pie charts to ignore selections made in one of my list boxes, but to react to selections in other list boxes.

Longer version:

I have two pie charts.

I want one to show percentages for all clients in a year, and the other to show percentages for the selected client.

I want the first pie chart to stay locked on the all clients value even when individual clients are selected from a list box.

But, I also want the first pie chart to update when the selected year is changed.

So the first chart would be locked to show the expression value for all clients, but move as different years are selected.

The expression being used is a Count([field name]) expression, but I will likely be building some SUM/AGGR weighted average stuff around the field being counted.  I saw Sum({1} [field name]) elsewhere, but it locked the whole chartand had a count of everything everywhere for that field and disregarded all selections.

End product should show a side-by-side comparison of aggregate data and client-specific data within the selected year.  Aside from year, I have fields like user status and data source that this chart should remain responsive to.

(The second pie chart would react to whatever is selected.  Only the first pie chart needs to be unresponsive to selections in the client list box.)

Thanks in advance!

-Steve

1 Solution

Accepted Solutions
Not applicable

Hi,

you can connect different objects (listbox) to different "alternate states" (document properties-> Alternate States). Then apply your chart to the specific "alternate state". The chart expressions could also be based on specific states, something like that:

Sum({[Alternate State 1]<[Product Sub Group]=, Year = $::Year, >} Sales).

Syntax description could be found under: http://community.qlik.com/message/210923

Hope that helps...

Sacho

View solution in original post

5 Replies
Not applicable

Hi,

you can connect different objects (listbox) to different "alternate states" (document properties-> Alternate States). Then apply your chart to the specific "alternate state". The chart expressions could also be based on specific states, something like that:

Sum({[Alternate State 1]<[Product Sub Group]=, Year = $::Year, >} Sales).

Syntax description could be found under: http://community.qlik.com/message/210923

Hope that helps...

Sacho

Anonymous
Not applicable

Steve, try this:

Count({1<Year=P(Year)>} [field name])

Regards,

Michael

rustyfishbones
Master II
Master II

Are you using Qlikview 11?, if so you should be able to use Alternate States in both the Pie Chart and the list box

If you are not using version 11, I am not sure how you can do it unless you change the list box field name in your script

stevelord
Specialist
Specialist
Author

Yes, I tried the formula first.  It seemed to work okay with the first two fields I put in, but then to stop after I added a few others for it to not lock.  Probably a syntax error or something on my part.

Fortunately, I do have QV 11 and the Alternate States solution is working like a charm.  I created one set of selection boxes for Aggregate Statistics and a copy of them under Client Statistics, and added Aggregate or Client to their titles to help users know which was doing what.

Funny, I was trying to put multiple states on each so I could have one box only work for the client chart, and the others work for both charts (or maybe have the one chart attached to both states).  That didn’t seem possible, but I have extra functionality with this extra set of listboxes, so oh well. ☺  (Not sure if anyone would want to compare 2012 aggregate to 2013 client data etcetera, but they could now.)

Good solid correct answer for Sacho since he pointed it out first.

stevelord
Specialist
Specialist
Author

This one seemed to work as typed above and after I added one or two more items in {} for the chart to follow, but then seemed to stop working when I had more than a few items in the {}.  Probably a syntax issue on my part or something with logic or nulls I was missing.

Still the answer worked with exactly the formula you gave up to a couple of {} items I had, so gets a helpful stamp.