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.
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.
1 -
Ah, beautiful. Thank you!
If this helps, feel free to agree, accept or awesome it!
0
Categories
- All Categories
- 1.2K Product Ideas
- 1.2K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 273 Workbench
- 2 Cloud Amplifier
- 3 Federated
- 2.7K Transform
- 78 SQL DataFlows
- 525 Datasets
- 2.1K Magic ETL
- 2.9K Visualize
- 2.2K Charting
- 437 Beast Mode
- 23 Variables
- 513 Automate
- 115 Apps
- 390 APIs & Domo Developer
- 8 Workflows
- 26 Predict
- 10 Jupyter Workspaces
- 16 R & Python Tiles
- 332 Distribute
- 77 Domo Everywhere
- 255 Scheduled Reports
- 66 Manage
- 66 Governance & Security
- 1 Product Release Questions
- Community Forums
- 40 Getting Started
- 26 Community Member Introductions
- 68 Community Announcements
- 4.8K Archive