Alteryx Designer Desktop Discussions

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

To parse comma separated input text and feed to filter tool custom function

MohamedThalhath
5 - Atom

How to convert comma separated string from dynamic input text tool and feed it to FILTER tool custom function. Please help.

 

For example, INPUT_TEXT value is like "787, 8989, 6768", the filter should be applied on the dataset using custom function below. But this filters using only the first value "787" and values after commas are omitted. How to get this working?

 

[FIELD] IN (ToNumber([INPUT_TEXT]))

4 REPLIES 4
vizAlter
12 - Quasar

Hi @MohamedThalhath — Can you attach the sample workflow to answer your query.

 

Or you can use "Text To Columns" tool and 1st apply "Split to rows" in your field, then convert that into the numbers using your function.

MohamedThalhath
5 - Atom

@vizAlter Attached the sample workflow.

vizAlter
12 - Quasar

Hi @MohamedThalhath — I am unable to run your attached workflow as did not find the file for Input.

 

Your macro asks for "Enter the codes for filtering" and it is enabled for Multi-lines, so user can write/paste the data in any manner (free-text - extra spaces, commas etc. might come).

Hence, 1st you need to put all the manually entered "Codes" in a single column and clean them if needed, then refer that Field in your Filter.

 

Hope attached the logic/solution will be helpful, if not let me know.

 

 

If this helps your issue please mark the answer as "Solved" with a Like, if not let me know!

MohamedThalhath
5 - Atom

This suggestion helped me to resolve the issue. Adding Text to Column and Regex in my workflow solved the issue.

Labels