Batch Macro to filter using a checkbox with values from a field
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am trying to create a macro that takes values from a field in the table, and shows that list to the user to input from and filter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi @vdix do you mean macro that allows the user to select from a list of options within a particular field to then apply to a filter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
yes that is right, i am trying to create an analytic app that allows the user to pick the file (within folders titled month name) so i added the corresponding month name to the file's record. i am unable to figure out how to configure the List box tool and also how to output it to pass it down to a dynamic input tool... @kakuffo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @vdix, unless I'm misunderstanding the request, it sounds like you want to create an App here instead of a macro, as you require User Input. Whilst learning Alteryx, I built a simple app that does what you seem to be asking - creating a list of unique values in a field that is then presented to the end user to filter on, with the option to select multiple from a List Box. In my example, I just want to be able to filter the list of coffee shops by market:
To create the list, group by the target field twice - I tend to just call them Name/Value for ease:
Next step is to Cross-Tab the data so that you just end up with a single row of data, with each cell matching it's header:
Now, as you want to be able to select multiple, this method relies on you using a filter with the 'IN' function, rather than Contains() or =.
When it comes to configuring the List Box tool, you'll want to select Generate Custom List and leave the 3 boxes as is. All this is doing is adding the relevant punctuation before/after/between each selection, as when you run the app with multiple markets selected, you'll end up with an expression like [Market] IN ('North', 'South', 'West') under the hood, where Alteryx has automatically placed ',' between selections, and ' at the start and end.
In your Action tool configuration, you're going to want to replace the expression value and you need to tick to Replace a specific string, as you only want your selection to effect the part of the expression within the brackets (which in this case is 'South').
When you come to Run as Analytical App (the magic wand icon next to 'Run'), your end user will then be presented with the list of all possible markets (or whichever field you want them to filter on).
And in the resulting document, you'll see that there are only records relating to the selected values (South & East in this case).
If we open the app in Debug mode, using the same selections, we can see what I was talking about earlier, where Alteryx has automatically populated the 'IN' expression with the selected values, with the correct punctuation around these to build the filter expression correctly.
I've attached my demonstration app for you to play with/reverse engineer. Hope this helps but do let us know if not!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry @vdix, was typing out my reply when you mentioned this being used to select files. If that's your use case, could you not just use a File Browse tool? This prompts the user to navigate to and select a file (shown below), which you can then use to update a Data Input tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi,
i'm actually trying to use it with a directory tool to filter out the filepaths based on the list box conditions, then pass it to a dynamic input tool to merge those files.
so i want to be able to select multiple files which are in month wise folders, so there is a file inside a January folder and so on, so i want to show that list of months to filter the filepaths selected then output it to the dynamic input tool
how can i go about achieving this?
