# Effortlessly (ish) Extract Email Addresses with ChatGPT in Tableau

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2023-01-18
- **Format:** Video · 14 min watch · transcript available
- **Topics:** Data visualisation, AI & ML
- **Tools:** Tableau (calculated fields, regexp extract)
- **Canonical:** https://just-tim.com/posts/effortlessly-ish-extract-email-addresses-with-chatgpt-in-tableau
- **Watch:** https://www.youtube.com/watch?v=G6VQHs4QSAk

I test whether ChatGPT can help me write a Tableau calculation to extract email addresses from paragraphs of free text. I compare asking Google versus ChatGPT, follow ChatGPT's instructions, and troubleshoot where its answer falls short with the REGEXP_EXTRACT function and capture groups.

## Key takeaways

- REGEXP_EXTRACT() can pull an email out of a free-text field in Tableau, but it needs a capture group (brackets) around the pattern to return a result rather than nulls.
- ChatGPT invented a non-existent right-click 'extract' menu option and even returned the wrong function name (regex instead of regexp), so its instructions can be confidently wrong.
- ChatGPT gets you roughly 80% of the way there; the final 20% — capture groups, correct syntax, validation — still needs your own domain knowledge.
- ChatGPT is genuinely useful for explaining what an existing regex pattern does, especially when you ask a follow-up to break it down part by part.
- Validate any regex in a dedicated tool like regex 101 with sample data before applying it to real data in Tableau.

## Chapters

- 0:00 The email extraction problem
- 0:55 Asking Google versus ChatGPT
- 3:38 Following ChatGPT's wrong instructions
- 4:52 Fixing the formula with a capture group
- 6:45 Rephrasing the question
- 10:09 Using ChatGPT to explain regex
- 11:52 Validating with regex 101
- 13:24 Verdict on ChatGPT for calculations

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/effortlessly-ish-extract-email-addresses-with-chatgpt-in-tableau

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
