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

Using Data From Different Alternate States In The Same Chart Expression

I'm working on a huge app and this is my current stumbling block.  It's sort of difficult to explain so I've put together a sample file that shows it pretty well.

Basically, I need to compare Clients in both total Sales and total Volume.  I do this by having charts in two different alternate states.  There are also two drop-down lists, each in those same alternate states, so the user can specify which two Clients to compare.  I've also got a button that will automatically select the top 2 Clients, by either Sales or Volume.

All of that works.  What I need now is a pie chart with two slices, one for each Client, showing the total Volume.  This is tricky because the expression will have to grab the Clients from the two alternate states.  My current attempt at it is broken, but none of my other attempts worked either.

My real application will have six Clients in the pie chart (and six drop-downs and six tables), so this example is really stripped down.

Any suggestions?

Thanks,

Bill

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi, Please, try this expression on your pie chart.

=Sum({$<Client={'$(=Only({BandwidthA}Client ))' , '$(=Only({BandwidthB}Client ))'} >  } Volume)

Regards,

Erich

View solution in original post

2 Replies
erichshiino
Partner - Master
Partner - Master

Hi, Please, try this expression on your pie chart.

=Sum({$<Client={'$(=Only({BandwidthA}Client ))' , '$(=Only({BandwidthB}Client ))'} >  } Volume)

Regards,

Erich

billbois
Creator
Creator
Author

Brilliant, thank you.

I modified it slightly, changing the first $ to a 1 so it would not be affected by other selections:

=Sum({1<Client={'$(=Only({BandwidthA}Client ))' , '$(=Only({BandwidthB}Client ))'} > } Volume)

Other than that, it's perfect.  Thanks again!