Skip to main content
Announcements
Jan 15, Trends 2025! Get expert guidance to thrive post-AI with After AI: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Tee_dubs
Contributor III
Contributor III

Filtering by the result of a Calculated Expression

I want to have a filter box to see and filter by the results of a calculated measure. For example, I'm looking at maintenance tasks required for an aircraft.
I have a calculated expression (RangeMin(monthly interval, 12/ (flight_hour_interval / (avg(kmperyear)))

It tells me based on the utilization of an aircraft if the monthly limit or the flight hours limit will be reached first (and convert it into a monthly interval)

It works well but I want to filter based on the results of that calculation. I.e show all tasks due at 14 months.

Ive converted this calculation into a variable (lowest_Interval) and tried a nested if approach if(lowest_Interval = 14, '14 months',
if(lowest_Interval = 15, '15 months', 'null'))
Ect
It's not working. Any tips??
Labels (2)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You'll want to wrap your calc in an aggr(), using the Dimension field you want to associate selections with:

aggr( (RangeMin(monthly interval, 12/ (flight_hour_interval / (avg(kmperyear))), TaskId)

See: https://qlikviewcookbook.com/2016/01/scoping-selections-with-aggr/

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You'll want to wrap your calc in an aggr(), using the Dimension field you want to associate selections with:

aggr( (RangeMin(monthly interval, 12/ (flight_hour_interval / (avg(kmperyear))), TaskId)

See: https://qlikviewcookbook.com/2016/01/scoping-selections-with-aggr/

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Tee_dubs
Contributor III
Contributor III
Author

Great. Now can I bucket them. Values between 1-6,7-12 ect