Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all, swuehljohnwmarcus_sommermarcowedelstalwar1,
I have a list box in my dashboard showing the Year field. I've the following requirement-
1) There will be always one selected value, possibly the current Year,
2) The Clear All button should not work on the Year field i.e. if you click on Clear All button, the Year selection should not clear.
3) User should have the flexibility to select more than one year value from the list box.
Please guide how to achieve all three together. Its a bit urgent so any help will be appreciated.
Thanks in advance.
Joy
Hi,
maybe one solution might be an OnSelect Field Event Trigger on the Year field with a "Select in Field" action and a Search String expression like:
=If(GetSelectedCount(Year)=0,'('&Concat({$1} DISTINCT Year, '|')&')','('&Concat(DISTINCT Year, '|')&')')
hope this helps
regards
Marco
You're welcome.
Please close your thread once you feel that your question is answered:
Qlik Community Tip: Marking Replies as Correct or Helpful
thanks
regards
Marco
some other expressions that should work as well:
=If(GetSelectedCount(Year),'('&Concat(DISTINCT Year, '|')&')','('&Concat({$1} DISTINCT Year, '|')&')')
or maybe
='('&Concat($(=If(GetSelectedCount(Year),'','{$1}')) DISTINCT Year, '|')&')'
hope this helps
regards
Marco
1) We have option called "Always one select value" - This should be check after selection only
2) In fact, Even if you try with Clear All button or in built it won't effect because you have Always one select value checked
3) This case, Might you need one more object which help by Alternate States
HTH
Or go to Setting -->Document Properties --> Triggers --> Document Event Triggers
and setup Trigger for:
1. OnAnySelect (-->Select in Field: Field = Year, Value = 2017)
2. OnOpen by adding an Action (-->Select in Field: Field = Year, Value = 2017)
Save doc and restart!
Hope this helps
Hi Frank,
Thanks for your quick reply, but I can't select more than one value from the list box. I have to achieve that as well with high priority.
Hi anil,
Thanks for your quick reply. Let see what others suggest.
Hi,
maybe one solution might be an OnSelect Field Event Trigger on the Year field with a "Select in Field" action and a Search String expression like:
=If(GetSelectedCount(Year)=0,'('&Concat({$1} DISTINCT Year, '|')&')','('&Concat(DISTINCT Year, '|')&')')
hope this helps
regards
Marco
Hi Marco,
Its an wonderful solution. Its working fine. Although need to do some R & D to check how its working. Thanks for the help. I'll get back to you after using it more.
Thanks,
Joy
You're welcome.
Please close your thread once you feel that your question is answered:
Qlik Community Tip: Marking Replies as Correct or Helpful
thanks
regards
Marco
some other expressions that should work as well:
=If(GetSelectedCount(Year),'('&Concat(DISTINCT Year, '|')&')','('&Concat({$1} DISTINCT Year, '|')&')')
or maybe
='('&Concat($(=If(GetSelectedCount(Year),'','{$1}')) DISTINCT Year, '|')&')'
hope this helps
regards
Marco