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 to any 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 to any 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.5K Product Ideas
- 1.5K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 278 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.7K Transform
- 89 SQL DataFlows
- 559 Datasets
- 2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 574 Beast Mode
- 12 App Studio
- 28 Variables
- 582 Automate
- 141 Apps
- 414 APIs & Domo Developer
- 26 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 356 Distribute
- 95 Domo Everywhere
- 259 Scheduled Reports
- 2 Software Integrations
- 92 Manage
- 89 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 89 Community Announcements
- 4.8K Archive