Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 34 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 273 Oracle Analytics and AI News
- 48 Oracle Analytics and AI Videos
- 16.2K Oracle Analytics and AI Forums
- 6.3K Oracle Analytics and AI Idea Labs
- Oracle Analytics and AI User Groups
- 100 Oracle Analytics and AI Trainings
- 16 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Nested Statements
I have a column with a custom title of "Estimated ship date" but with the formula
CASE WHEN "Order Detail - Oe Order Release"."Revised EST Ship Date" IS NULL THEN "Order Detail - Oe Order Release"."Original EST Ship Date" ELSE "Order Detail - Oe Order Release"."Revised EST Ship Date" END
Is it possible to add a condition that leaves the value as Null if the resulting date is before the current date? I know how to use the >date - 1
My initial thought was to create a new column using another CASE WHEN statement but when I try to insert the column it fills in the whole
CASE WHEN "Order Detail - Oe Order Release"."Revised EST Ship Date" IS NULL THEN "Order Detail - Oe Order Release"."Original EST Ship Date" ELSE "Order Detail - Oe Order Release"."Revised EST Ship Date" END
statement but I get a bad column name error.
If I try to manually enter it just as "Order Detail - Oe Order Release"."Estimated Ship Date" I get the same error.
I feel like there must be an easier way to do this.
Answers
-
Hi,
Embedding multiple CASE WHEN works, if you got an error you should check the logic of what what happening.
What you could also try is to simplify your first CASE WHEN because it can be replaced by the IFNULL() formula.
A random guess of what you could try:
CASE WHEN IFNULL("Order Detail - Oe Order Release"."Revised EST Ship Date", "Order Detail - Oe Order Release"."Original EST Ship Date") >= CURRENT_DATE THEN IFNULL("Order Detail - Oe Order Release"."Revised EST Ship Date", "Order Detail - Oe Order Release"."Original EST Ship Date") END0
