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
- 1.1K Product Ideas
- 1.1K Ideas Exchange
- 1.2K Connect
- 970 Connectors
- 259 Workbench
- Cloud Amplifier
- 1 Federated
- 2.4K Transform
- 76 SQL DataFlows
- 502 Datasets
- 1.8K Magic ETL
- 2.7K Visualize
- 2.2K Charting
- 379 Beast Mode
- 21 Variables
- 487 Automate
- 104 Apps
- 379 APIs & Domo Developer
- 6 Workflows
- 22 Predict
- 6 Jupyter Workspaces
- 16 R & Python Tiles
- 319 Distribute
- 67 Domo Everywhere
- 252 Scheduled Reports
- 59 Manage
- 59 Governance & Security
- 1 Product Release Questions
- 5K Community Forums
- 37 Getting Started
- 23 Community Member Introductions
- 64 Community Announcements
- 4.8K Archive