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: 
crystles
Partner - Creator III
Partner - Creator III

Keep at least one selection in a specific field

I need to be able to have a Year field, in a List Box, always selected on a specific sheet. However, I don't want this to carry over and effect other sheets in the document.

I know I can set the List Box option, "Always One Selected". But that will keep the year selected for all sheets, always, and I don't want that.

Also, I know that I could solve the problem above by using an alternate state too. But I would prefer to not have to do that, since I would have to select alternate states for every object on the sheet and the sheet and I need some other filters on the page to carry over to the other sheets so I need those selections to matter.... plus, things can get kind of crazy with too many Alternate States, and I'm using 3 alternate states already.

Is there perhaps another way to make that field always have a year selected when on this page without doing the above mentioned options?

7 Replies
swuehl
MVP
MVP

Maybe you can work around using some approach that was 'recently' discussed in

How to clear the Always One selected value

tamilarasu
Champion
Champion

Hello Crystle.

Have a look at the attached file.

crystles
Partner - Creator III
Partner - Creator III
Author

I tried your document, but it still let me unselect the years field and have no years selected?

trdandamudi
Master II
Master II

Please take a look at the attached file and hope this is what you are looking for. (Note: I took Nagaraj file and modified the actions, so that it wont allow you to unselect the year field). Hope this helps...

Anonymous
Not applicable

Not sure your scenario, but you could also use set analysis on the expression to pick a year automatically on the Sheet you always want a year selected.  For instance, if no year is selected, you might want the data to show the max year.  Create a variable to pull the max year.  Then put that variable in your expressions in your one sheet that always needs a year.

Then when a year is not filtered to your sheet will show the most recent year in your data.

If a year is selected, it will also change to that year.

swuehl
MVP
MVP

Maybe you can combine the above posted approach to save and restore selections when moving to other sheets with

ListBox - Always at least one Selected Value needed (not Always One Selected Value)

(and also restrict selections to exactly one value).

sangland2
Partner - Creator
Partner - Creator

You could use a calculation condition on the Chart - General tab to prevent the chart displaying until something is selected, eg: GetSelectedCount(FiscalYear)>0. Use Error Messgages on the General Tab - "Calculation condition unfulfilled" to tell the user why nothing is displayed, eg "Please select Financial Year"

Then a Sheet Trigger "OnLeave Sheet", Add Selection action type "Clear Field" and specify your field.