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.
Solved! Go to Solution.
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.
Let me know if you have any questions.
James
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]
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
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)
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
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
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
7) Now when I run the app, the filter expression is updated with the values I select
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.
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.
I am using the same values as you mentioned
action tool
list box
Filter Parameter
any idea ?
@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.
Thank you @DataNath
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |