Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

billbois
New Contributor III

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

Tags (1)
1 Solution

Accepted Solutions
erich_shiino
Honored Contributor

Re: Using Data From Different Alternate States In The Same Chart Expression

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

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

Regards,

Erich

2 Replies
erich_shiino
Honored Contributor

Re: Using Data From Different Alternate States In The Same Chart Expression

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

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

Regards,

Erich

Highlighted
billbois
New Contributor III

Re: Using Data From Different Alternate States In The Same Chart Expression

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!