Case when SYNTAX
Hi all,
I am trying to write a case statement for a column when we see a null to grab another column. I am not sure why I am not getting the output expected.
Can someone take a look and maybe advise?
Essentially 36534370 and 36534369 from the investor_loan_id column should be in the left column as well.
**I've tried to change both columns to integers and back, that wasnt the issue
If this helps, feel free to agree, accept or awesome it!
Best Answer
-
Did you try skipping the transform to null?
Case when coalesce(trim(`commitment`), '') ='' then `loan` else `commitment` end
I can't find this written anywhere, so maybe I'm making it up, but I'm pretty sure you can't THEN NULL to return nulls. I'm surprised it's not throwing a syntax error.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
1
Answers
-
Did you try skipping the transform to null?
Case when coalesce(trim(`commitment`), '') ='' then `loan` else `commitment` end
I can't find this written anywhere, so maybe I'm making it up, but I'm pretty sure you can't THEN NULL to return nulls. I'm surprised it's not throwing a syntax error.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
1 -
Ah, beautiful. Thank you!
If this helps, feel free to agree, accept or awesome it!
0
Categories
- All Categories
- Product Ideas
- 2.1K Ideas Exchange
- Data Connections
- 1.3K Connectors
- 309 Workbench
- 17 Cloud Integrations
- Data & ETL
- 2.3K Magic ETL
- 120 SQL DataFlows
- 666 Datasets
- Visualize & Apps
- 90 App Studio
- 198 Pro-code Components
- 2.6K Charting & Analyzer
- 873 Calculations & Variables (Beast Mode)
- AI & Data science
- 23 Domo AI & AI Chat
- 4 Managing AI
- 18 Jupyter Workspaces
- Automate
- 122 Workflows
- Alerts
- Distribute
- 118 Domo Everywhere
- 284 Reporting
- Manage
- 145 Governance & Security
- 489 APIs
- 11 Add-ins & Plugins
- 13 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 118 Community Announcements
- 5K Archive