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
1
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
1 -
That's awesome! Thanks Superman!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive