2

I have two list boxes: Box1 and Box2. Box1 has values 10,20,30,40 etc and Box2 has the same 10,20,30 etc.

After creating two separate list boxes for Box1 and Box2 respectively in the dashboard, how do I get to show only the values in Box2 which are greater than the selected value/values in Box1.

Example: When I click 20 in Box1, I want the values 30, 40 etc to be displayed or shown in box2 i.e., the values greater than 20 has to be displayed. Thank you.

Archid
  • 377
  • 6
  • 21

2 Answers2

2

An alternative way to do this would be to create a List Box but instead of setting it to use a normal field, set it to use an expression instead (select it in the "Field" drop down in the properties).

You could then use the following expression which should do the trick:

=aggr(if(F2 > max(F1),F2,if(GetSelectedCount(F1)<>0,null(),F2)),F2)

In the above, the first field is F1 (i.e. Box1) and the second is F2 (i.e. Box2).

An example of how it looks in practice is shown below (the third box on the right contains the expression), the first image shows what happens if some values are selected in F1 - the list of values are filtered.

In the second image, a selection has been made in this new list box, and as you can see, it makes a selection against F2 automatically.

An example from QlikView when using the expression An example from QlikView when using the expression and selecting values

i_saw_drones
  • 3,486
  • 1
  • 31
  • 50
  • This is another great alternative to do it as well. Thank you – Archid May 01 '15 at 16:27
  • Also, this works better for multiple selections and if we do not want to utilize the trigger function. So I would go for this solution any day if I am not going to use triggers. – Archid May 01 '15 at 16:29
1

There are few ways to achieve this.

  • set "On select" trigger for Box1 field. The trigger will clear selected values on Box2 and select only the values that are greater than Box1 selected value
  • in script - this highly depends on the dataset you have. The idea is to join Box1 and Box2 fields in separate table as many-to-many and then filter the values where Box2 > Box1. Using this approach is more clear to me and no triggers are needed but again it depends on your data.

Ive made a small app which shows the two approaches https://drive.google.com/file/d/0BxjGsOE_3VoOc29aYXVsanN3azA/view?usp=sharing

Community
  • 1
  • 1
Stefan Stoichev
  • 4,615
  • 3
  • 31
  • 51