Failed to Convert Value from String Type to Boolean
Hi!
I'm trying to setup a formula in my ETL where when the Registration Date is greater than 06/22/2021 we get the Order Item including the nulls. Before that date, I need the formula to include all order items but instead of nulls, I need it to say 'No Order Item'.
So it would look like this originally.
Registration Date | Order Item |
---|---|
1/1/2020 | |
2/2/2020 | 1234 |
7/1/2021 | |
9/1/2023 | 5678 |
After the formula
Registration Date | Order Item |
---|---|
1/1/2020 | No Order Item |
2/2/2020 | 1234 |
7/1/2021 | |
9/1/2023 | 5678 |
case when Registration Date
< 06/22/2021 then Order Item
when Registration Date
<= 06/22/2021 and IFNULL(Order Item
) then 'No Order Item' else Order Item
end
The formula seems to work except for the error message. I tried concating the order item and tried to use IN, but that didn't work.
Thanks for your help!
Best Answer
-
@Cfunk here you go. A couple of issues with your original beast mode.
- You needed to wrap your date string inside of DATE() to convert from string type to date type.
- IFNULL() requires 2 arguments, something to check if null, and a replacement string.
Updated Beast Mode
CASE
WHEN Registration Date < DATE('2021-06-22') then IFNULL(Order Item,'No Order Item')
else Order Item
ENDExample output
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1
Answers
-
@Cfunk here you go. A couple of issues with your original beast mode.
- You needed to wrap your date string inside of DATE() to convert from string type to date type.
- IFNULL() requires 2 arguments, something to check if null, and a replacement string.
Updated Beast Mode
CASE
WHEN Registration Date < DATE('2021-06-22') then IFNULL(Order Item,'No Order Item')
else Order Item
ENDExample output
David Cunningham
** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
** Did this solve your problem? Accept it as a solution! ✔️**1
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
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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