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: 
joydipp1988
Creator
Creator

Listbox object to show always one selected value with flexibility to select more than one value from the list

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

3 Solutions

Accepted Solutions
MarcoWedel

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, '|')&')')

QlikCommunity_Thread_253869_Pic1.JPG

hope this helps

regards

Marco

View solution in original post

MarcoWedel

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

View solution in original post

MarcoWedel

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

View solution in original post

8 Replies
Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Frank_Hartmann
Master II
Master II

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

joydipp1988
Creator
Creator
Author

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.

joydipp1988
Creator
Creator
Author

Hi anil,

Thanks for your quick reply. Let see what others suggest.

MarcoWedel

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, '|')&')')

QlikCommunity_Thread_253869_Pic1.JPG

hope this helps

regards

Marco

joydipp1988
Creator
Creator
Author

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

MarcoWedel

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

MarcoWedel

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