Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Restrict List Box selection to two items

Hi there

I have a list box that has three items. I have a chart that runs a compare on any two of the three items,. I have a couple of questions please:

1. How can I set up the llist box such that the user must  two of the items, otherwise no chart is displayed?

2. How can I set up the chart so that it displays depending on the two items selected? I have the three items set up as variables but can't work out hoe to get them to work.

Any help appreciated.

thanks

John

1 Solution

Accepted Solutions
MayilVahanan

hi

try like this

=Getselectedcount(fieldname) = 2
in general properties -> calculation condition

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
MayilVahanan

hi

try like this

=Getselectedcount(fieldname) = 2
in general properties -> calculation condition

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

I'm not sure if we have an option to restrict the no of selections. But we can use hide using condition like sample in attachment to present the functionality

Hope it helps

er_mohit
Master II
Master II

In chart general tab under calculation condition

write the name of field used in list box

i.e count(Distinct Fieldname)=2

and below click on  error message

and in calulation condition unfulfilled write

Please Select atleast Two Fieldname to view the Report

hope it helps

VishalWaghole
Specialist II
Specialist II

Hi John,

Try this,

Go To General Tab,

Under General Tab Go To Calculation Condition use this Code.

=GetSelectedCount(ListBoxFieldName) = 2

Thanks

Vishal Waghole

vinothkumarr
Partner - Contributor II
Partner - Contributor II

Hi John,

Please try the below one.

In the Chart -> Properties->General->Calculated Condition

" =Getselectedcount("FieldName")=2 "

Then provide a Error message in the below place.

In the Chart -> Properties->General->Error Messages

Custom:

Please select any 2 values of "FieldName" to see the comparision analysis.

Note:- "FieldName" refers the Field used in the List box.

Hope this helps!

--

Vinoth

Not applicable
Author

Hi John,

PFA. Hope it helps!

qv_testing
Specialist II
Specialist II

Hi,

PFA

Not applicable
Author

HI All,

Thanks for all the great answers... It worked:). I have a follow on question:

I have a chart with two axes, I want one to display data based on the first selection in the list box and the second axis to display based on the second list box item selected. I'm using the GetFieldSelections ("ForecastVersion")  function but can't work out how to incorporate that into my expression. The expression I have i shown below, where the variable is what I currently have set to generate one axis on the chart. I would like to replace the variable with the List box selection. Given that I have two asex, I would need to be able to assign each selection to a seperate chart.

(Sum({$<Measure={'Total Sales'}, ForecastVersion={$(vLast_Forecast)}>}Data))

All help gratefully appreciated.

Regards

John