Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is it possible to filter my chart dimension with set analysis instead of if?

I have a qlikview document about some places with each place having X and Y coordinates. I want to display data in a straight table, but only for the places in an user-defined area. This area is defined by 4 variables X_MIN, Y_MIN, X_MAX and Y_MAX which the user can define them through 2 sliders objects.

In order to filter the chart to only display places included in this area, I first try a calculated dimension with this expression:

if(X>X_MIN AND X <X_MAX AND Y>Y_MIN AND Y<Y_MAX, placeID, Null() )

It works as I want, however the performance quickly decreases when there is a lot of data. I know that set analysis perform a lot better than if statements but I do not know how to replace my expression to use a set analysis instead of an if. Set analysis can change the set of data on which an aggregate function operates, however I am not aggregating anything here, only filtering the placeID field based on a condition.

Is it possible to use a set analysis instead of the if ? Is there a better way to achieve what I want?

1 Reply
swuehl
MVP
MVP

You are probably using an expression in your chart, so there is an aggregation involved (check out Henric's latest Technical design blog post for more details).

if you are using something like

=sum(Sales)

the set expression version might look like

=sum({<X={">=$(X_MIN)<=$(X_MAX)"},Y={">=$(Y_MIN)<=$(Y_MAX)"} >} Sales)

with dimension just

placeID