Beast Mode to change value in Column A based on Value in Column B
Hi there!
I have a table that includes a Site ID column and a Site Name Column. I want to change the Site Name when the Site ID = x. I have the following code which works but it creates a new column but I don't want a new column, instead I want to change the Site Name in the existing site name column. Many thx in advance!
Chris
CASE when `Site ID` = x AND `Site Name` = 'OLD NAME'
then 'NEW NAME'
else `Site Name`
end
Best Answer
-
You just need to filter your list first.
I created a basic dataset to try to mimic this for you here:
In this case, I have two Site IDs that have the same customer name, "Clark Kent". The first step is to create two filters. One that contains the data that you don't want to change, and one that has everything you want changed...Don't Change
Data to Change
Then, you use replace text to make your change:
Next, you append the two tables:
Now, any combination of site b and Clark Kent has been changed to site b and Superman
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1
Answers
-
If you don't want to create a new column, you would need to do this in the ETL. You can use the Replace Text function to replace a site name with a different site name and not add it as a new column
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Thanks for your response!
I couldn't find a way to do this with an ETL because I have several customers with the same name but different site ID. I only want to change the name when both the site ID and name matches what I'm looking for. I can do this in both an ETL and a Beast mode but only by adding a new column.
Thx again!0 -
You just need to filter your list first.
I created a basic dataset to try to mimic this for you here:
In this case, I have two Site IDs that have the same customer name, "Clark Kent". The first step is to create two filters. One that contains the data that you don't want to change, and one that has everything you want changed...Don't Change
Data to Change
Then, you use replace text to make your change:
Next, you append the two tables:
Now, any combination of site b and Clark Kent has been changed to site b and Superman
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman1 -
That's awesome! Thanks Superman!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 297 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive