Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pradnyat
Creator
Creator

Alternate State Issue

Hi All,

I am facing one tricky issue.

I have 1 straight table for which I am using Alternate State named 'Alternate State1' .

I have 1 dimension named 'Contract'. My requirement is the Straight table should be displayed only when no contract is selected i.e

in layout I need to add expression as :

getselectedcount(Contract)=0

In normal situations this condition will work , but as I am using Alternate State for the chart, Contract selections are not affecting on that table, and we can't use the ($) symbol in layout expression to affect based on current selection as this is not feasible in getSelectedCount expression.

Is there any other way to make this work?

Thanks in Advance ...!

5 Replies
Gysbert_Wassenaar

In QV 11.20 SR8 the getselectedcount function accepts an additional parameter for the alternate state:

=GetSelectedCount(Contract ,'StateA')

If that version is not available and upgrading not an option you can do a check only if the number of possible values is not limited by selections in other fields: =if( count({StateA}distinct Contract) = fieldvaluecount('Contract'), 1, 0)


talk is cheap, supply exceeds demand
pradnyat
Creator
Creator
Author

Thanks Gysbert,

But we are using QV 11.20 SR5. So, this function is not working there.

Is there any other workaround for this.

pradnyat
Creator
Creator
Author

We can't use  if( count({StateA}distinct Contract) = fieldvaluecount('Contract'), 1, 0) function as the data is restricting by other field selections.

pradnyat
Creator
Creator
Author

Is there any workaround for this ??

avkeep01
Partner - Specialist
Partner - Specialist

Hi PradnyaT‌,

I had the same issue, you can try using

COUNT(DISTINCT {[StateA]} Contract) = COUNT(DISTINCT {1} Contract)

In this case when there are no selections made in StateA the count of the contracts should be the same as alle the contracts (state =1 is ignore all selections). When there is a selection made then the count of the contracts is unequal to the count of all the contracts.

regards