Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alternate State and GetSelectedCount

Hi everyone,

I am using alternate states in my QlikView Dashboard to allow user´s to compare different versions of forecasts.

The alternate states are called 'Forecast1' and 'Forecast2'.

The charts that are linked to this comparison work fine - as long as only ONE forecast version is selected in each alternate state. That´s why I want to prevent my users from selecting more than one forecast version.

Can someone please help me formulate the statement for the "Show>Conditional" Field in my Layout tab? The name of the field is ForecastVersion. I have already tried to use GetSelectedCount but it seems to malfunction with alternate states.

Thanks for your help,

Lina

6 Replies
simondachstr
Luminary Alumni
Luminary Alumni

Try using Only({Forecast1} ForecastVersion) and Only({Forecast2} ForecastVersion).


Luckily in your case, if ForecastVersion is anything but one specific Forecast Version  Only() will evaluate to null().


So something like

isNull(Only({Forecast1} ForecastVersion))<>-1

should do

Colin-Albert

QlikView v11.2 SR8 has additional functionality for Alternate States

SR8 Alternate state parameter for certain functions

New parameter added to the functions “GetSelectedCount()”, “GetFieldSelections()” and

“GetCurrentSelections()” to query other states than the main state.

E.g. =GetFieldSelections(Quantity, ';', ,'StateA')

More details in the release notes and in this post

http://community.qlik.com/blogs/supportupdates/2014/09/09/qlikview-1120-service-release-8-is-now-ava...

Not applicable
Author

Hi Lina to prevent this.

You can set "Always One selected" property of the list box for both alternate states.

other option would be using if( isnull(subfield(Concat(distinct {Platform1}Platform,'|') ,'|',2)) in the contion.

Colin-Albert

I prefer to use maxstring() rather than only() as maxstring() will always return one value whereas only() will return null if nothing or mukltiple values are selected.

simondachstr
Luminary Alumni
Luminary Alumni

I agree, but in her case if nothing is selected I don't think she wants anything to be displayed, thus the only() expression. Next to that, maxstring() will return always return one value. This will be the one with the longest string which might confuse the user, if he has nothing selected e.g..

calvintang
Contributor III
Contributor III

This is fantastic! It works for me in 2022!