Hi all,
I need some assistance removing a word from a column using the Regex tool?
Thank you,
Stephanie
Hi @Sclifton1098 Are you looking to remove the PettyCash entries? I presume they would not be capitalized.
You could use a filter tool with a statement like: !Startswith([Detail],"PettyCash")
Hi @Sclifton1098,
You don't need RegEx to do this (at least not based on your screenshot). @Luke_C has provided a solution for a filter tool
Hi @Sclifton1098
The regex tool cannot remove records from the workflow. You could use a regex_match function in a filter tool if regex is required, although that's not the ideal solution (regex uses more memory, so when a simple string function can be used that's better).
!Regex_Match([Details],'PettyCash.*')
The same function I listed above can be leveraged in a regex tool set to match mode. It will result in a true/false column that you can then filter. Again this is not the most efficient way but understand you have an assignment. I'd suggest reading the below post, and don't forget to mark helpful replies as solutions.
https://community.alteryx.com/t5/Alteryx-Community-Resources/Posting-for-Fastest-Possible-Solution/ta-p/178481
Can you post a sample of the data?
Hey @Sclifton1098,
Would you be able to give a couple examples of the text and the word you want to extract? If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20Data
Below is a screenshot of what the assignment is asking. I have to remorve the PettyCash from the detail column to expense those accounts.
Thank you!
@Sclifton1098 if you just need to remove 'a word' rather than a certain pattern, would a regular string function like Replace() not suffice? Here we want to remove the word 'please' and so we just replace it with nothing:
Below is the data.
@Sclifton1098
The description and link in your image make me think a filter tool is more appropriate, however without seeing the actual data the ask is still unclear
We are trying to exclude the data that is petty Cash amounts that are in the detail column, we are trying to remove those rows.
Thank you! My professor is requiring the use of Regex tool.
Thank you all very much! I will stick with the filter tool.
Hi Luke! Is there a way to move all of the petty cash accounts from the detail column to a new column with the Regex tool?
What do you mean by 'move' them? Just the descriptions in a new column? The amounts as well? Can you post the data (not a screenshot) along with your desired outcome?
Yes I believe the objective is to move the Petty Cash account to a new column
I believe the assignment is asking to Parse the data that is Petty Cash to a new column to exlude it
Thank you for your help! I have to use the parse output method
Maybe the ask is to parse the check numbers? That would make more sense. Again posting the actual data and expected results will yield you much better quality responses. Most folks would prefer not to have to re-type data based on screenshots.