Magic ETL Trim left of decimal
I noticed there isn't a ton (easily found) info on the different Regex to use to trim off data.
My use case was I had a file using a numbering system before a product. So instead of saying Lowe's, Home Depot, Walmart it would sayd 1.Lowes, 2. Home Depot, and 3. Walmart. I found some regex that drops the period and what's to the left of it.
So here you go.
Use the Replace Text >>> Click the Gear on Step 2 >>>> Check "Use RegEx" >>> set the expression to ^[^.]*. and it will work
Best Answers
-
I noticed there isn't a ton (easily found) info on the different Regex to use to trim off data.
My use case was I had a file using Zip codes. Some of the Zip codes in the .xls have 92056-1234. Well, when you try to join that data to Domo's Fips to Zips Dimension you have to get rid of the dash and everything after it. The trick here is you can't use a trim on the last 5 because you only want to trim those data which have the dash in it.
So here you go.
Use the Replace Text >>> Click the Gear on Step 2 >>>> Check "Use RegEx" >>> set the expression to \-.*$ and it will work
3 -
Canio - That is a great solution! REGEX is incredibly powerful, but as you stated, it can be hard to find intuitive solutions unless you've spent a lot of time in the syntax. Domo's Knowledge Base recommends the Java Tutorial for some deep information on the inner workings of the functionality (https://docs.oracle.com/javase/tutorial/essential/regex/).
I've found that it is also helpful to use some other sites like Regex101 (https://regex101.com/) to build out and experiment with different patterns.
Cody Irwin
Manager, Technical Solutions
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Answers
-
I noticed there isn't a ton (easily found) info on the different Regex to use to trim off data.
My use case was I had a file using Zip codes. Some of the Zip codes in the .xls have 92056-1234. Well, when you try to join that data to Domo's Fips to Zips Dimension you have to get rid of the dash and everything after it. The trick here is you can't use a trim on the last 5 because you only want to trim those data which have the dash in it.
So here you go.
Use the Replace Text >>> Click the Gear on Step 2 >>>> Check "Use RegEx" >>> set the expression to \-.*$ and it will work
3 -
Canio - That is a great solution! REGEX is incredibly powerful, but as you stated, it can be hard to find intuitive solutions unless you've spent a lot of time in the syntax. Domo's Knowledge Base recommends the Java Tutorial for some deep information on the inner workings of the functionality (https://docs.oracle.com/javase/tutorial/essential/regex/).
I've found that it is also helpful to use some other sites like Regex101 (https://regex101.com/) to build out and experiment with different patterns.
Cody Irwin
Manager, Technical Solutions
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"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
- 56 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