Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ol_dev
Contributor III
Contributor III

Qliksense Filterpane(Listbox): How to select zero or one value?

It seems that by default all fields in Qliksense allows multi-selection, though it is possible to edit field settings to allow each field to be single selection. The issue however, is that it is not possible to default to an unselected(zero-selected) state, instead one value has to always be selected. Is there a workaround to allow either 0 or 1 value to be selected? Or is this a planned feature in future Qliksense? Please help. 

ol_dev_0-1710265347695.png

 

Labels (3)
10 Replies
SemBL83
Partner Ambassador
Partner Ambassador

Hi,

If I understand correctly, you wish to have a default selection that 'somewhat' is a blank option. Users are then still only allowed to make just one selection at a time. Is this correct?

There's no feature like that and I'm guessing there's nothing in development that is simmilar to this. A workaround that I can think of is this:

Load your calendar datekey as a resident and create a field (CalendarYear) with text like 'All years' as values and then concatenate this to your calender.

This will effectively allow your users to select the value All years and this will correspond with all available dates in your data model. 

Does this help you?

With kind regards,

Sem

pravinboniface
Creator II
Creator II

@ol_dev Another option, which may or may not work for you- if you have Vizlib Filter, you can use the Data Handling option that comes with Vizlib Filter.

Calculation condition: "if (getselectedcount(myfield)<2,1,0)"

Displayed message: "Only zero or one selection is allowed. Clear filter and try again"

dataexplorer
Contributor III
Contributor III

To answer, "The issue however, is that it is not possible to default to an unselected(zero-selected) state" it is not possible. The art behind Qlik is all about filtering.

A work around can be that if an On Open Sheet Action can be added to the different fields, which then narrows down to a single value in the required associated CalenderYear field

ol_dev
Contributor III
Contributor III
Author

@SemBL83 

Yeah I thought about this too, that a blank 'please select' option may be needed as a workaround. In this case, can you provide an email on how to concatenate a field with a 'None Selected' or 'Please Select' value? Also can this value be hidden from the selection list, but selected automatically if the user unselect an option? 

@pravinboniface 

Thanks for the suggestion, unfortunately Vizlib will not work for us. The issue is not even with pricing, but that Vizlib UIs are not 508 compliant, that its extension objects do not support keyboard navigation for users who need accessibility support. Our project heavily relies on being 508 compliant, so we cannot use a filter without accessibility feature built in. 

LRuCelver
Partner - Creator III
Partner - Creator III

I had one case where only a single sheet needed the single selection in a date field.

What we ended up doing is always using the max possible date for all charts on that sheet. If the users selects more than one date, the subtitles/footers in the charts will warn them that only the max date is being considered.

ol_dev
Contributor III
Contributor III
Author

@LRuCelver 

Well the CalendarYear is just one example in our Qliksense app that will need single selection, we have a lot more and not all of them are numeric values like year and months. 

marcus_sommer

It sounds a bit as if you want to implement a kind of navigation respectively look & feel like they are often used in web-forms in which a drop-down shows any kind of instruction and if the user clicked on it a value-list for the selection is shown.

Because of the fact that the entire Sense UI is web-based it should be possible to implement such behaviour there, too. But I doubt that there native features for it else I think it would require the usage of customized extensions.

Beside this I'm not sure if such a solutions is really expedient for a BI tool - does it really have an added value ....

SemBL83
Partner Ambassador
Partner Ambassador

It's been a while. Where you able to solve your problem?

Quick example:

Calendar:
LOAD * INLINE [
Id, CalendarYear
1, 2024
2, 2023
3, 2022
];

CONCATENATE (Calendar)
LOAD
Id,
'Please select' AS CalendarYear
RESIDENT Calendar;

 Mind you that the resident Calender loads all individual values in the Id field and stores the text value 'Please select' as field CAlenderYear. It is then concatenated.

Now, when setting the 'Always one selected value', you can either choose 'Please select' as your default value, that now links to all available Id's (which should be your date key).

ol_dev
Contributor III
Contributor III
Author

@SemBL83 

Thx for your advice, it works for me. I have two more questions regarding this workaround: 

1. The selection toolbar will display 'Please select' by default or if it is selected, is there a way I can optionally hide the field from selection toolbar if the selected value is 'Please select'? Or is this not possible without using third party extensions? 

ol_dev_0-1715110579687.png

2. The 'Please select' shows up on top of the listbox, is it possible to hide this option, but make it selected when a user unselects another option? Basically to emulate selecting zero or one value.

ol_dev_1-1715110734034.png

Thx.