Creating a separate column using magic ETL
Hi there - I am trying to part of a value that is in a column and change it to be the full name. I keep getting syntax errors whehn going through ETL formula tiles.
My formula is alot larger than this but this is an example - I have tried = instead of Llike, as well as contains, nothing seems to be working (becuase the Campaign column is set up to be WBH - Wabash) so i figured like would be better than =
(Case
when 'Campaign' like 'WBH' then 'Wabash'
Else 'Not Linked'
End)
Best Answer
-
@Stucker A couple notes on your formula:
- Campaign is being recognized as a text value instead of a dataset field when using single quotes. Wrapping it in the ` character should resolve this
- You will need to include the % wildcard when using the LIKE operator. If WBH is always at the beginning of the string you can use
like 'WBH%'
, or if it can be anywhere in the string you can uselike '%WBH%'
1
Answers
-
@Stucker A couple notes on your formula:
- Campaign is being recognized as a text value instead of a dataset field when using single quotes. Wrapping it in the ` character should resolve this
- You will need to include the % wildcard when using the LIKE operator. If WBH is always at the beginning of the string you can use
like 'WBH%'
, or if it can be anywhere in the string you can uselike '%WBH%'
1 -
I agree with everything @MichelleH said, it's likely the lack of % or difference between ` or ' are causing your syntax errors. I would add to keep in mind that CASE statements are evaluated sequentially when using the LIKE operator.
If your data includes values such as 'WBH - Wisconsin' and 'WBH - Wabash' evaluating like 'WBH%' then 'Wabash' before 'WBH - Wisc%' then 'Wisconsin' will result in both values being evaluated as 'Wabash'
1 -
If you are trying to graph or count occurrences in a dynamic way. I would suggest something like this…
Say you create two calculated fields: field_1 and field_2. Field one representing the abbreviation (ie WBH). Field two being the name of the thing (ie. Wabash).Field_1: SPLIT_PART(
Campaign
, ' ', 1)
Field_2: SPLIT_PART(Campaign
, ' ', 3)
Then just place them in the chart with the aggregate (count in this case).(apologies…in the actual chart, I used Field3 rather than Field2.)
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **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