We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex issue

Dots1982
6 - Meteoroid

If anyone knows why the below formula in Formula tool is returning (?=.*\\b\\b) everytime then let me know....I'm just following CHATGPT

 

IIF(Length(Trim([K1_2]))>0, "(?=.*\\b" + Regex_Replace([K1_2], "([.^$|()\\[\\]{}*+?\\\\])", "\\\\$1") + "\\b)", "")

11 REPLIES 11
Dots1982
6 - Meteoroid

thanks, and this workflow will work every time with a new set of invoices....

 

And if you can..confirm co-pilot is correct in breaking down the steps you advise?

 

Recommended Step-by-Step Approach

  1. Assign a Unique Record ID

Each row in your primary dataset (e.g., from <File>Proprietary data.xlsx) should be given a unique recordid. This allows you to track and group results accurately throughout the workflow.

  1. Split the 'Map' Column into Words

Take the text from the first column (e.g., “GB Unitary Fees 2 Country Related Fees”) and split it into individual words. This transforms each record into multiple rows—one for each word—making it easier to match against your word mapping source.

  1. Prepare the Word Mapping Source

From your mapping file (e.g., <File>Split_Mappings for discussion .xlsx), extract all relevant words or phrases that represent standardized categories. Assign a recordid to each entry in this source as well.

  1. Perform a Join

Use a Join tool to match each word from your exploded dataset against the word mapping source. This identifies which words from your raw data appear in the mapping reference.

  1. Summarize: Count Matches per Record

Use a Summarize tool to:

  • Group by recordid from your original dataset.
  • Count how many words matched from the mapping source. This gives you a match score for each record.
  1. Identify the Best Match

Use another Summarize tool to:

  • Find the recordid with the maximum match count. This is the record that most closely aligns with your mapping source.

 

apathetichell
20 - Arcturus

@Dots1982 - hey - my recommendation here is use these instructions/my instructions --- see the results. You have to put tool to canvas and start doing/learning and stop asking for hand holding from community/copilot/chatgpt or whatever.

Labels
Top Solution Authors