Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
AmCh
Creator
Creator

Using the GetFieldSelections()

Hello all,

I have as an example:

Field_a
x
y
z

 

I want to do some calculations based on the value selected in Field_a (as an example GetFieldSelections(Field_a)=y)

let vTest_y=B0_y + B1_y + B2_y;

B0_y, B1_y, B2_y are already loaded as fields.

I want only to catch them based on the selected value and to affect the calculated value into new variable named vTest_y.

Any help please?

Thanks in advance.

2 Replies
Dalton_Ruer
Support
Support

Logically GetFieldSelections is a function that will return to you the value that is selected for the given field. So if your user manually selected Y, then GetFieldSelections("field_a") would return the value Y. 

I think what you may be trying to do is create an expression that pretends that the end user selected the value Y in "field_a". Within Qlik that is called Set Analysis which you can find out more about by clicking here

However, I'm not really sure what you are trying to accomplish. 

AmCh
Creator
Creator
Author

Thank you for your reply.

set analysis cannot help me in this case, because field_a is not associated to other fields (e.g. B0, B1 and B2).

Based on the selected value of field_a (for example y), I want to call the fields B0_y,B1_y and B2_y, which are already imported and named like that. I want only to catch them, and with them to define a new variable named vTest_y.

In other words: I want to use values of field_a only to catch and to name.