How do I use data in one column to replace data in a different column in Beast Mode?

I need to create a new column that pulls data in from one column but changes only certain cells to another value based on a value in the same row from a different column.
This is what I have tried:
CASE WHEN 'column A' = "xyz" THEN 'column B' 'abc' ELSE 'column B' END
CASE WHEN 'column A' = "xyz" THEN 'column B'='abc' ELSE 'column B' END
CASE WHEN 'column A' = "xyz" THEN 'column B' ,'abc' ELSE 'column B' END
CASE WHEN 'column A' = "xyz" THEN 'column B' 'abc' END
CASE WHEN 'column A' = "xyz" THEN 'column B', 'abc' END
CASE WHEN 'column A' = "xyz" THEN 'column B'='abc' END
I keep getting a syntax error message. How can I fix this please?
Best Answer
-
Your syntax needs to be like this:
CASE WHEN
column A
= 'xyz' THEN 'abc' ELSEcolumn B
ENDWhen referencing the columns in your dataset, make use of the autocomplete when starting to type out your column so that you know it is being referenced properly. When comparing it to a string, put single quotes around the string. Column names will have a backtick around them and will be colored differently than string values.
This resulting beast mode should be used in place of column B in your chart/table.
Hope this helps.
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.0
Answers
-
Your syntax needs to be like this:
CASE WHEN
column A
= 'xyz' THEN 'abc' ELSEcolumn B
ENDWhen referencing the columns in your dataset, make use of the autocomplete when starting to type out your column so that you know it is being referenced properly. When comparing it to a string, put single quotes around the string. Column names will have a backtick around them and will be colored differently than string values.
This resulting beast mode should be used in place of column B in your chart/table.
Hope this helps.
**Check out my Domo Tips & Tricks Videos
**Make sure toany users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Hi Mark- thank you for the answer. This worked thank you!!!
0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 660 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 816 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 84 App Studio
- 46 Variables
- 779 Automate
- 191 Apps
- 482 APIs & Domo Developer
- 83 Workflows
- 23 Code Engine
- 41 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 2 AI Projects and Models
- 18 Jupyter Workspaces
- 413 Distribute
- 121 Domo Everywhere
- 281 Scheduled Reports
- 11 Software Integrations
- 145 Manage
- 141 Governance & Security
- 8 Domo Community Gallery
- 49 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 4.8K Archive