on ‎2021 May 18 11:28 AM
Hi,
I have a cds view with below case statements. Like this, i have so many case statements based on same condition. Is there any way to exclude this case statements many times because it is impacting performance of the cds view. Any suggestions.
case when low is not null or low is not initial
then OpenQtyValue* -1
else OpenQtyValue
end as OpenQtyValue,
case when low is not null or low is not initial
then conv_openqtyvalue* -1
else conv_openqtyvalue
end as conv_openqtyvalue,
Request clarification before answering.
Hi, If u have the same condition for many case statements then better go with UNION ALL
like:
select from myTable {
OpenQtyValue - 1 as OpenQtyValue,
conv_openqtyvalue -1 as conv_openqtyvalue
} where low is not null or low is not initial
UNION ALL
select from myTable {
OpenQtyValue,
conv_openqtyvalue
} where low is null or low is initial
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.