Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Enable one selection based on other


I have Year and Month selection. I want to keep Month Read only untill someone click on Year Seleciton. So idea is that User should pick a year and then Month. Without picking a year and selecting a Month will give them aggregation of all years for that month which they might not want.

Screenshot.png

6 Replies
chiru_thota
Specialist
Specialist

There is a trick.

Place one text object on Month list box and make it transparent.

for text object Layout--> Layer --> Top.

In Layout--> Conditional --> GetSelectedCount(Year) =0

.

its_anandrjs

1.Take one Year List box

2.Month list box one is set to Read only and in Properties -> layout -> conditional -> type =GetSelectedCount(YourYearField)=0.

3.Place second Month list exactly on below of the first month list box and dont make it read only.

When ever any user click on month list box he not able to select it when ever he select the year then it will active

Hope this helps

nagaiank
Specialist III
Specialist III

If you will be selecting only one year and one month, having two list boxes, one for year and the second one for month, conditionally enabled on year being selected will work.

If you need to select more than one month in the application, having Year-Month field and selecting Year-Month will be desirable option. What if you want to select 2013-Dec and 2014-Jan?

Hope this helps.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

I would just set a show condition on the Month list box.  This is set on the Layout tab under Show Conditional.  It would need to be something like:

=GetPossibleCount(Year) = 1 or GetSelectedCount(Month) <> 0

This means the month list box would also show if the month had been selected some other way (perhaps by highlighting bars on a chart).

Personally, I would take the time to educate your users about Green, White and Gray, and what selecting a Month without a year will do for them.  It works the same way as any other list box and you are expecting them to deal with that?  Another way to do dates (which allows selected the end of one year and the start of another) is to have a multibox of Month/Year values - rather than separating out the two fields.

Hope that helps,

Steve

Not applicable
Author

Hi ,

I brought one more list box and made it read only..upon seleting year, i am hiding it and unhiding selectable.

Thanks all,,,  I was looking to use only one list box with some condition that could make it disable if no value in year waas selected

whiteline
Master II
Master II

Without picking a year and selecting a Month will give them aggregation of all years for that month which they might not want.

In this case 'always one selected' property is worth to use for the Year listbox.