If condition between two columns

Hello, could you help me with a calculation to create a new column in my table: If the "Fixed Value" column has a value, add "Fixed Contract" but if the "Spot" column has a value, put "Spot Contracts" in the newly created column.
Best Answers
-
case when Fixed Value is not null then "Fixed Contract" when Spot is not null then "Spot Contract" else "Undefined" END
I don't have your actual data, so this is assuming that there is never a time when both "Fixed Value" and "Spot" are both populated, and that you don't have to check any other conditions. I threw in an ELSE to catch other cases.
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1 -
@DanieleSilva You can use the following case statement either in Beast Mode or an ETL formula tile:
case when `Fixed Value` is not null then 'Fixed Contract' when `Spot` is not null then 'Spot' end
1
Answers
-
case when Fixed Value is not null then "Fixed Contract" when Spot is not null then "Spot Contract" else "Undefined" END
I don't have your actual data, so this is assuming that there is never a time when both "Fixed Value" and "Spot" are both populated, and that you don't have to check any other conditions. I threw in an ELSE to catch other cases.
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1 -
@DanieleSilva You can use the following case statement either in Beast Mode or an ETL formula tile:
case when `Fixed Value` is not null then 'Fixed Contract' when `Spot` is not null then 'Spot' end
1 -
Thank you for sending this and sorry for the delay. This is my first time using DOMO, so I may be doing something wrong because I couldn't do it. I would like to know which ETL option I should use to create the "Fixed Contract" and "Spot Contract" columns. The columns I have as Fixed Value and Spot (BRL) are numeric.
0 -
You would use the Formula Tile in MagicETL and then use the code provided above. You can name this column whatever you want.
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1 -
Thanks David! It worked!
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
- 658 Datasets
- 116 SQL DataFlows
- 2.2K Magic ETL
- 815 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 82 App Studio
- 45 Variables
- 775 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 81 Workflows
- 23 Code Engine
- 40 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 1 AI Projects and Models
- 18 Jupyter Workspaces
- 410 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 10 Software Integrations
- 144 Manage
- 140 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive