modify the below code with case statement which should validate in sap datasphere If [SALESORGCODE] = "5800" Or [SALESORGCODE] = "5831" Then "AOFC" Else If [SALESORGCODE] = "6300" Or [SALESORGCODE] = "6500" Then "AL SEER OMAN" Else Upper([DTL_SALES_DESC]
In SAP DataSphere (also known as SAP HANA Cloud), you can use a `CASE` statement to achieve the conditional logic you're looking for. Here's how you could modify your code using a `CASE` statement:
```sql
CASE
WHEN [SALESORGCODE] = '5800' OR [SALESORGCODE] = '5831' THEN 'AOFC'
WHEN [SALESORGCODE] = '6300' OR [SALESORGCODE] = '6500' THEN 'AL SEER OMAN'
ELSE UPPER([DTL_SALES_DESC])
END
```
In this code:
- The `CASE` statement evaluates each condition in the order they appear.
- If a condition is met, it returns the corresponding value.
- If none of the specified conditions are met, it defaults to the `UPPER([DTL_SALES_DESC])` value.
This construct is valid in SAP DataSphere and should work correctly for your requirements.