Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting and using variables in list selections

Hello,

I have two different list selections on my sheet and the second one is connected to the first by a common field. In my example I have the different departments of the company in the first list and all the available machines in the second list. Each machine is located in a particular department.

When I select department A, only the machine available in that department are selectable. The matter is that the box is huge, therefore I would like the box to only show the machines corresponding to that department.

I tried different expressions like if(getselectionsfield(DEPARTMENT), MACHINES) or if(match(...) but it doesn't seems to work.

I looked up on the internet and it seems that variables could work, but I don't know how to define them and how to use them in the expression. I'm not even sure it will work 😕

Thanks a lot!

1 Solution

Accepted Solutions
Not applicable
Author

=if(Department=GetFieldSelections(Department),Machine)

add this expression to Machine  List box.

This should work, but the list wont display nothing if department is not selected.

View solution in original post

8 Replies
ecolomer
Master II
Master II

See this examples ... ¿is that you need?

Not applicable
Author

Try Hide Excluded in List box Properties->General settings.then it will display only related data and other will be not seen.

Not applicable
Author

I can't open others files sorry 😕

Not applicable
Author

It's what I have now, but the matter is that the selection list size s too big due to the amount of machines; therefore, I'm trying not to hide the values but rather delete them from the list selections. So when I change from department A to B, the machines that are shown in the second list selection are the only one that are situated in department B.

Not applicable
Author

I am not sure if we could achieve in list or not. But we can use straight table to achieve this.

You can create a straight table with dimension as Machine, add rowno() as expression. Then hide rowno expression in presentation property. You can also  remove caption in layout.

Now this will be similar to list with only related values and auto resize.

Not applicable
Author

Since the list of machines can change over the years or months, I would like to leave my datas like that and not create an intermediate table which will have to be changed by hand in Qlikview or Excel...

What I have now is something like that:

I would like somthing like this:

If(getselectionfield(DEPARTMENT)='vDepartment'), show me the valued of MACHINES that corresponds to the selected department ^^ I know it's not easy.

Not applicable
Author

=if(Department=GetFieldSelections(Department),Machine)

add this expression to Machine  List box.

This should work, but the list wont display nothing if department is not selected.

Not applicable
Author

Oh well weird, I tried something like that yesterday and it didn't work properly and now it works

Thanks a lots