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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing a field value to another field

Hi,

I want to pass the values selected in 'Field 1' as a filter for 'Field 2'. I tried using a variable to get the selected values of 'Field 1' and pass the variable value to 'Field 2' using set analysis. But, the variable value is always null. The variable definition I used is given below:


getFieldSelections([Field 1])


I am not sure why the variable is not getting the selected 'Field 1' values. Is there any other way to resolve this?

Thanks in advance.

-Haneesh

1 Solution

Accepted Solutions
sparur
Specialist II
Specialist II

Hello, Haneesh

Please, see in my example.

I created a Result table where I use set analysis for restricting values of field2 by selections on Field1

View solution in original post

14 Replies
Not applicable
Author

hi,

If there is a single value selection then you can do this by using trigger.

You have to go in the document properties trigger-->field event trigger---->select the field on that selection is going on ----> add action on select ----->choose external----->set variable---->Give the name of variable you have defined to store the vale ----->in the value just put the name of the field in which selection will be done.

You can able to find the value of selection in your defined variable.which can be used for the other purpose.

regards,

Ravi

Not applicable
Author

Thanks Ravi. Unfortunately this is not a single value selection. Will this work for multi select also?

Thanks,

Haneesh

Not applicable
Author

Check whether you are using the same field name([Field 1]) for any variables. If so, change the variable name.

Not applicable
Author

I am not using the same name for the variable, but still the selected values are not assigned to the variables.

Can someone throw some lights on this?

-Haneesh

Not applicable
Author

Hi Haneesh,

I used trigger to save selected values to a variable. You will see in a text box the value passed to a variable. Also in 2nd list box I used the variable in filtering. Hope this one helps

Please see attached file

regards,

Not applicable
Author

Thanks Ronald.

The attached document does not have any text box and list box. Can you upload the correct file again.

-Haneesh

sparur
Specialist II
Specialist II

Hello, Haneesh

Please, see in my example.

I created a Result table where I use set analysis for restricting values of field2 by selections on Field1

Not applicable
Author

Thanks Anatoly.

I have previously done the same. But, the variable value is always null 😞

I am using QV 9 SR3 and have checked this on SR4 also. Could this be due to the version? any ideas?

Regards,

Haneesh

Not applicable
Author

Hi Haneesh,

Sorry for that.

I re upload my sample file