Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
avantime
Creator II
Creator II

LIST BOX - If none selected, select all

Hi

In the attached app I am loading 5 items, A, B, C, D, E.

In a listbox I am showing only A B C D, without E. I am also preselecting these 4 values.

The problem is that after I select one or more items in the listbox, once I clear the selection E is also selected by default.

How can I force the listbox to select ABCD by default?

Hope I made myself understood .

17 Replies
avantime
Creator II
Creator II
Author

Is it possible to tie this function to just a specific sheet? I tried adding "AND GetActiveSheetId()='SH01'" in the if condition, but it doesn`t work.

Thanks!

surendraj
Specialist
Specialist

Yes..You can apply the same trigger on

Right click-->Properties-->Triggers-->OnActivateSheet-->Select in field-->

Item==If(GetSelectedCount(ITEM)=0, '(A|B|C|D)', '('&Concat(DISTINCT ITEM, '|')&')' ).

This means when ever you select perticular sheet(SH01),this action will activated.

avantime
Creator II
Creator II
Author

Thanks but this works until I select an ITEM, then it doesn`t work anymore. It needs to be tied to OnAnySelect..

surendraj
Specialist
Specialist

In your application you need to apply 2 triggers

1.select in field-->ITEM=(A|B|C|D)

2.select in field-->ITEM==If(GetSelectedCount(ITEM)=0, '(A|B|C|D)', '('&Concat(DISTINCT ITEM, '|')&')' ).


By this you no need to select ITEM.when ever you activates SH01.it will apply,Means it will be applicable to specific sheet only.

sunny_talwar

May be this?

=If(GetActiveSheetId() = 'Document\SH01',

  If(GetSelectedCount(ITEM)=0, '(A|B|C|D)', '('&Concat(DISTINCT ITEM, '|')&')' ))

avantime
Creator II
Creator II
Author

Hey Sunny, thanks for your advice, unfortunately I cannot select anything in the other sheet. Your example has the same issue

avantime
Creator II
Creator II
Author

I don`t need to select the item, but if I do, the selection I asked at the beginning of this thread disappears. See Tresesco B`s reply.

avantime
Creator II
Creator II
Author

solved it somehow.. I gave the other sheet an alternate state.