Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to choose what to filter on in an analytical App

jbh1128d1
10 - Fireball

Hello,

 

I have a filter that I want to the user to be able to change based on the checkboxes that are selected.   However, it's not working.  The interface looks how I want butit's nto working.  Pictures of filter and WF below. 

 

Capture.JPG

 

Capture2.JPG

12 REPLIES 12
CharlieS
17 - Castor
17 - Castor

If it's just one field you want to filer on, then you're close. Rather than a filter tool, I used a Join tool. I have attached an example.

jbh1128d1
10 - Fireball

Hi @CharlieS.  Do you have the input file?  I can't tell how this is working. 

CharlieS
17 - Castor
17 - Castor

My appologies. I have attached a new version with a Text Input tool as well as the original input file.

jbh1128d1
10 - Fireball

When I check multiple selections on yours and mine, it has no output file.  When i check only one, it does on mine but I couldn't get yours to work.  

jbh1128d1
10 - Fireball

Here is mine with sample data. 

DylanB
Alteryx Alumni (Retired)

You can do this by creating a custom list from the listbox matching the style of the "IN" function.

 

The "IN" function compares a value to a comma-delimited list to see whether it's equal to one of the members (e.g. 'A in("x", "y", "z")' returns true when A is "x" or "y" or "z" but false else).

 

In the listbox configuration, instead of having it create the list (which would look like ("x=True, y=False, z=True") in the default manner), create a list with "," as the delimiter and update the expression accordingly.

 

I'm attaching a minimal example. I used different names and values for the listbox elements to show that when you do that, the values get passed to the filter, not the names. It does work if the names and values are identical.

jbh1128d1
10 - Fireball

What if the number of values can change periodically?

jbh1128d1
10 - Fireball

Ok. So this work if I list every county.  The issue is the user will load different files from different states and therefore different counties.  I need to have the app be able to dynamically change the the list that will show up.

DylanB
Alteryx Alumni (Retired)

It won't matter. The filter gets auto-populated by whatever is selected before pressing "Run" on the app. If you want an easier way (compared to tinkering with the macro/app) to change them frequently, see the different options on the listbox tool. One is "External Source"; it would be appropriate using this to save the set of values as a CSV with "NAME" and "VALUE" fields and update there (presumably automatically as part of whatever process you use to decide which values to include) whenever you want to update values.

 

* sorry - this was a reply to the post above (re when they change)

Labels