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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Input Box triggers Expression filter

Guys, I'm having an issue with something that seems simple.

I need to set a filter on a dimension, say "Area" in the attached example, based upon an input field that corresponds to an expression...Sum(Revenue). As I need to filter upon an aggregate, I can't just look to the base-level "Revenue" field.

Since I want the input box to change the set of available Areas on other tabs, it's not enough to just put an IF statement in the chart to hide the rows that are below the threshhold.

While a search box (on the expression) or a slider seem to work, what am I doing wrong that's preventing the input box from using the trigger to do the same thing?

With thanks,

Frank

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Please find attached to see its working how you want. When using select in field, the field value cant be a function, can only be a field name. So had to create an expression in the search string to get the required values. The formula I used was:

='(' & Concat(if(aggr(sum(Revenue),Area)> vMinAggregatedRevenue, Area), '|') & ')'

in the search string section of trigger.

Hope this helps!

View solution in original post

5 Replies
jerem1234
Specialist II
Specialist II

Please find attached to see its working how you want. When using select in field, the field value cant be a function, can only be a field name. So had to create an expression in the search string to get the required values. The formula I used was:

='(' & Concat(if(aggr(sum(Revenue),Area)> vMinAggregatedRevenue, Area), '|') & ')'

in the search string section of trigger.

Hope this helps!

Anonymous
Not applicable
Author

Perfect...many thanks!

phcaptjim
Creator
Creator

This works well, except for one minor detail that I have been unable to resolve.

If you input revenue, the selection works perfectly.  If you increase the value you originally input, the selection again works well.  However, if you first input 40, you get the correct selections, but if you now enter 10, you do not get the proper selections.  it's only checking the currently selected instead of checking all values.  I have tried clearing the field using a trigger but that is not working.

Does anyone have any solutions?  It seems it should be a simple fix.

Thanks!

jerem1234
Specialist II
Specialist II

Yep, like you said it goes based on selected values. So when you have the selected values, the concat is reduced to what is selected. Therefore you need to ignore selections, so you have to add in 1's to set analysis. To edit the original equation, it would be:

='(' & Concat({1}if(aggr(sum({1}Revenue),Area)> vMinAggregatedRevenue, Area), '|') & ')'

Make sure both concat AND sum get the 1.

Hope this helps!

phcaptjim
Creator
Creator

Thanks!  I added the {1} but only after the SUM and not after the CONCAT function.  Ooops.  Works great now!