Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
guidocobs
Contributor
Contributor

Select one or more value filter on a sheet

Hello everybody,

I have a dimension of my visual (Field name : 'LAG' | Possible values : '1','3','6','12',)

which I want it to have the following behavior:

At least one value selected (predefined '3')

So the user should be able to :

1 - change from 3 to any other value

2 - add multiple values

I only want this action activated on a selected sheet and not for all the App.

I tried adding action " Select values in a field" 

with value      ='('&if(GetSelectedCount( LAG )=0,GetFieldSelections( LAG) )&')'

but is not working.

Anyone can support on this?

Thanks in advance for helping

 

3 Replies
Quy_Nguyen
Specialist
Specialist

Hi,

You could try this one for the action "Select value in a field":

=If(GetSelectedCount(LAG ) = 0, '3', GetFieldSelections (LAG ,';'))

This action will be trigger when you open the sheet, if nothing is selected for LAG field then '3' will be selected; if there are existing selections for LAG field then selections remains.

guidocobs
Contributor
Contributor
Author

Hello Nguyen!

Thank you for your support and your reply.

Actually this solution is triggering on selection "3" when the sheet is opening, but not preventing the user to cancel the selection, leaving at least one value selected.

Do you know if exists the possibility of apply this behavior?

Thanks in advance

Guido

Quy_Nguyen
Specialist
Specialist

Hi,

There are some additional options:

1. Set the field LAG option to always one selected value, so user can not clear the selection. But in this case, user can not select more than one value.

Quy_Nguyen_0-1617871617929.png

 

2. Using extension for your filter: I suggest using this extension https://github.com/mediassarQlikBranch/SimpleFieldSelect

You need to create a filter by the extension in the sheet you want to apply your logic. For example I am setting default AR value for my State field:

Quy_Nguyen_1-1617871779378.png

by using this, you will achieve:

+ Always have your default value selected (even clicking the clear selection in the current sheet - you can clear selection in other sheet which doesn't contains this filter)

+ Able to select multiple values

+ Keep current selection on that field when moving from other sheet to this sheet ( if nothing is selected, default value will be applied)

p/s: you can change the filter style under dimensions/visualization to checkbox, listbox, qlikfilter style...