How do I create a calculated field for a string starting after a certain set of characters?
I'm trying to create a calculated field from an export of email messages that will capture a string AFTER a certain character set. In other words, the field will read something like:
How do I remove my payment information from your website? ------------------ Submitted from: https://www.example.com/example
I want the output of the calculated field to be the URL (https://www.example.com/example ) for cases where both the URL and the text before "------------------ Submitted from:" can vary widely. I imagine this can be done with a SUBSTR or INSTR function (or combination thereof) but I'm not sure how to do this.
Thanks!
Comments
-
Hello,
You should be able to use substring_index function.
SUBSTRING_INDEX(`description`, '------------------ Submitted from: ', -1) as url
Basically this function looks at your field value (description), finds the string you want to locate, and then the negative 1 takes everything to the right.
Hope this helps,
Brian
**Please mark "Accept as Solution" if this post solves your problem
**Say "Thanks" by clicking the "heart" in the post that helped you.0 -
Hey,
Let me just recap your situation:
Before:
"How do I remove my payment information from your website? ------------------ Submitted from: https://www.example.com/example"
After:
"https://www.example.com/example"
Assume all URLs obey the same pattern which they all start with "http://www". I think its fair assumption unless there will be two "http://www"s.
My solution:
SUBSTRING(`Country`,INSTR(`Country`,'https://www'),LENGTH(`Country`)-INSTR(`Country`,'https://www')+1)
What you need to do:
1. replace `Country` with the field that contains your full text with URL inside.
2. Boom
Note: I know it seems like long and difficult. Free free to reply if you are still not able to or need in-depth explanation.
1
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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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