Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zhaohaifeng
Contributor III
Contributor III

Qliksense if GetFieldSelections in dimension

Hi All,

 

In our requirement, we want to add one filter Flag(no relationship) with Region and Territory, in our chart dimension, we want to use based on what we select in filter,  the dimension is =if(GetFieldSelections(Flag)='Territory',rep,[区]), screenshot as below,

clipboard_image_0.png

but when we click the bar in the chart , it should dimension Region selected in the top, now Territory also in the top selection, do you know how can i do, dont let another dimension selected? Also attached the qvf for youre refrence.

clipboard_image_1.png

Best Regards,

Haifeng

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Qlik does the selection whatever you given as expression in the dimension

=if(Flag='Territory',rep,[区])

but when you use the vDimension  variable in place of above expression, which has value of =if(Flag='Territory','rep','[区]'). it will evaluate and use the output value as dimension, it does the selection for that field only.

Note: when I use the variable, field names are within single quotes.

 

PS: Mark this post as solution, to avoid others spending time on your post to answer it.

View solution in original post

4 Replies
Lisa_P
Employee
Employee

Not sure if this is what you are asking, but if you go to the Flag field from the Assets panel on the left in Edit mode, you can right click on the Flag field and go into Field settings where you can check the box to make sure that either Region or Territory is always selected, but not both. (Always one selected value)

CELAMBARASAN
Partner - Champion
Partner - Champion

Create a Variable lets vDimension with below expression

=if(Flag='Territory','rep','[区]')

use $(vDimension) as your dimension

zhaohaifeng
Contributor III
Contributor III
Author

Thanks. it works now.

Can you help to explain the reason why with variable no issue happend? Thanks for your time first.

 

Best Regards,

Haifeng

CELAMBARASAN
Partner - Champion
Partner - Champion

Qlik does the selection whatever you given as expression in the dimension

=if(Flag='Territory',rep,[区])

but when you use the vDimension  variable in place of above expression, which has value of =if(Flag='Territory','rep','[区]'). it will evaluate and use the output value as dimension, it does the selection for that field only.

Note: when I use the variable, field names are within single quotes.

 

PS: Mark this post as solution, to avoid others spending time on your post to answer it.