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

Alteryx Designer Desktop Discussions

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

How to populate interface tool with values from a column ?

walkingbird
6 - Meteoroid

Example, i am using a input file which has column 'Date', with values JAN-2022, FEB-2022, MARCH-2022 etc. I would like the end user to be able to select multiple DATE values from the listbox ( either multiple or single value), so that it filters the data on the values selected by the user. How can i achieve this.?

Also, i would like that the values from the column DATE are populated in the list from which the user can make a selection.

Example input file attached.

5 REPLIES 5
JamesCharnley
13 - Pulsar

Hi @walkingbird ,

 

You're not too far off with this. The best way to populate the list box is with a summarize tool that groups by what you want to populate the list with twice, then crosstabbing so each value is its own field. 

 

Then in the configuration of the list box, you need to select generate custom list, and then configure an action tool to replace just that list that you've created, which is in the same format as the filter.

 

JamesCharnley_0-1663863637153.png

 

Let me know if you have any questions.

 

James

DataNath
17 - Castor
17 - Castor

Hey @walkingbird, when setting up an app in this way, there's a few standard steps to take:

 

1) Use a Summarize tool to Group By the field you want to use in your interface tool. I tend to do this twice and name one [Name] and the other [Value]

 

DataNath_0-1663863354174.png

 

2) Cross-Tab the outcome of the Summarize. The list box pulls in fields and their respective values and so here you're creating a field for every possible selection, alongside a single identical value

 

DataNath_1-1663863410137.png

 

3) As standard, the cross-tab will default special characters to an underscore and so here I just use a Dynamic Rename tool to replace underscores with a hyphen to revert back to the original format (that matches the data you're filtering)

 

DataNath_2-1663863459532.png

 

4) In your List Box, you need to select Generate Custom List. You can leave the configuration itself but what this does is create a list, with " before the first selected option, "," separating any in between and then " after the final selection. This is necessary as you're leveraging the IN function which needs values to be in a list of a "X","Y","Z" format in between the brackets

 

DataNath_3-1663863575341.png

 

5) In your Action tool, you need to specify that the only part of the filter expression to be updated is whatever you placed within the brackets when setting up the workflow, like so. The custom list created by the List Box tool replaces this

 

DataNath_4-1663863618410.png

 

6) Upon successful completion of the app, you need something that will show the results to the user. The easiest way to do this (unless uploading to gallery) is placing a Browse tool after the output of interest. After this you need to go into the Interface Designer (ctrl+alt+D) and tick to show that particular tool upon completion

 

DataNath_5-1663863703828.png

 

7) Now when I run the app, the filter expression is updated with the values I select

 

DataNath_6-1663863740546.png

 

Hopefully that helps and gives a little breakdown of what is going on at each step. If you need any further help or explanation, be sure to shout up! I've attached the amended app.

walkingbird
6 - Meteoroid

Thank you @DataNath , this is helpful, for some reason for my main dataset i am getting a debug issue when i run it.

 

Debug Screen

it remove the column name from the filter when it opens up in filter.

walkingbird_4-1663866216045.png

 

 

 I am using the same values as you mentioned

 

action tool

walkingbird_1-1663865996364.png

 

list box

 

walkingbird_2-1663866012233.png

 

Filter Parameter 

walkingbird_3-1663866046489.png

any idea ?

 

 

 

 

DataNath
17 - Castor
17 - Castor

@walkingbird in your action tool, you need to select the tick box at the bottom of the configuration to only replace a specific string. Then you want to reduce that so it only replaces the part you have in between the brackets when you set up the filter to start with, in your case the “APRIL-2021”,”MAY-2019” part.

 

My guess is at the minute you’ve just left the whole filter expression in there and so when the app runs it replaces everything, hence why you only see your selections in the debug.

walkingbird
6 - Meteoroid

Thank you @DataNath

Labels
Top Solution Authors