How can I create a new column with extracted numbers in SQL or ETL
I have a column called 'description' which can contain multiple elements. One of them is 'Order #1234567890' (or other digits). I want to create a new column that just extracts the numbers in SQL or Magic ETL (so that I can do Beast Modes etc. on it afterwards). How can I create this column? Numbers may exist in other elements, so I just want the numbers that are 9 digits or more. Thanks in advance!
Best Answer
-
I realize now that I can just edit the text in 'Text Formatting' to include just numbers. Thank you for your help!
0
Answers
-
I would recommend using Magic ETL for this as that would allow you to use regex expressions to find cases where there are 9 or more digits.
I'm not an expert with regex, but something like this may work:
^[-+\/\s]*([0-9][-+\/\s]*){9,}$
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Thanks Superman! I've learned a lot, but still learning. Which function in magic ETL would allow me to enter a regex formula? (I don't have advanced options).
Thanks!
0 -
I realize now that I can just edit the text in 'Text Formatting' to include just numbers. Thank you for your help!
0 -
Hi @user027926
For future reference you can use the the Replace Text tile with a regular expression and replacement variables. You just need to tell the Search Term field that you're using a regular expression.
Also replacement variables are in the format of $1, $2, etc instead of the traditional \1 or \2 like some other languages prefer.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
FYI, if you're on Magic 2.0 and you find the Formula tile more intuitive, you can build more sophisticated transforms using:
cc @GrantSmith
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thank you all! Really helpful!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive