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.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.4K Charting
- 710 Beast Mode
- 50 App Studio
- 39 Variables
- 668 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 33 Predict
- 13 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 103 Community Announcements
- 4.8K Archive