on 2021 Sep 08 10:44 AM
Hello experts,
I'm trying to use SAP ODATA APIs for a business requirement for sales dashboard and have observed the below anomaly while trying to filter data between two tx amounts in the query. Below is a snapshot of a table simplified to help set the context. I have a set of transactions with C_D meaning a credit or Debit type of transaction. Im interested to see month wise Debit & Credit groups where Tx amounts are between 60 to 90 (Both inclusive)
Below Query in SQL is giving the right result
select C_D,Month,count(TxID),sum (Amount) from Sample2 where Amount>=60 AND Amount<=90 group by C_D,Month;
Correct output:
But when I try the same on SAP ODATA API, I see below query is giving incorrect output
select C_D,Month,count(TxID),sum (Amount) from Sample2 where Amount ge 60 AND Amount le 90 group by C_D,Month;
Upon some analysis, I have observed that the second filter condition <=90 is being applied after grouping is completed with the first filter condition i.e >=60 which is incorrect and against the SQL principles.
Request to suggest if there is something that can be done to implement a between functionality on the amount to obtain the right result.
Request clarification before answering.
User | Count |
---|---|
68 | |
31 | |
9 | |
8 | |
7 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.