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

Button to filter data based on two fields....

I have received a request recently and I'm having a hard time figuring out how to do something that I'm sure could be done.  I have line level spend data for client that list out all of the PO's for their suppliers.  They are wanting to be able to filter the data to only show data from suppliers with spend over a certain threshold.  I have a variable that allows them to identify that threshold ('vSpendThreshold'), and I assume that I could use a button to prompt the filter.  My issue is how to create the search string using 'select in field'.  I've placed 'Supplier' in the 'Field' section and now I just need to figure out the syntax for the 'Search String' section.  I'm trying to base if off of a set analysis piece that I use in another part of the report, but to no avail.  The problem that I am running into is that the spend for a supplier will be in multiple rows, so I need it to add up the spend by supplier, and then perform the comparision to see if it meets the threshold. I've tried using AGGR and range some, but there aren't any combinations that seem to work.  This is the set analysis piece I use in another section:

{$<[Supplier Name] = {"=sum(Spend) > $(vSpendThreshold)"}>}

Am I even on the right track with trying to use a button for this or has anyone ever created something like this?  Any help would be greatly appreicated. 

6 Replies
Not applicable
Author

I would suggest you to group by the supplier.

Not applicable
Author

I'm not trying to adjust a chart or grapt, I'm trying to create a means of filtering all of the data in the analysis report. Similar to what can be done in a selections box, but instead of selecting the value in a given field, I am hoping to select multiple suppliers based on a how much spend they have, which is derived from another field.  This would effect the entire report in the current selection.   

adhudson
Creator II
Creator II

Hi,

     Can you share some sample data and qvw files?

Regards

Andrew Hudson

Not applicable
Author

Here is a sample data set, along with some of the logic around what I am trying to do.  Hopefully, this makes things clearer.  I'm not even sure that using a button is the right way, but it gives an idea of what I am trying to accomplish.  Any help is greatly appreciated. 

Not applicable
Author

So I noticed, that if I put "=Sum(Spend) > $(vFilterThreshold)" into the search on the Supplier list box, then it will filter the data as I am needing it.  I've have tried adding this to a button placing the code in the search string, but no syntax I use will work.  So is there possibly a macro I can create that would search the supplier list box placing the above code in the search box? 

BigSlique
Contributor
Contributor

I have the exact same problem. Have you managed to find a solution.