Skip to Content
0
R R
May 25, 2022 at 06:14 AM

SAP BODS - Sum of Records Group By

334 Views Last edit May 25, 2022 at 08:18 AM 2 rev

Hi All,

I have a Table with 10 Columns

I need to Sum 2 Columns using Grouping on 4 Columns.

I am Trying to achieve this by Query Transform

Step 1: Taken 6 columns into a New Query and applied Group By under GROUP BY tab for 4 columns and in the Mapping added aggregate function SUM() for that particular 2 columns - its working fine and getting record count as expected.

Step 2: Now I joined Queries (the Source Query and SUM query) to the next Query with a Join condition in WHERE tab

Now here its failing to filter the Records.

Source : 10 Records, after GROUP BY 6 Records

OUTPUT: I am getting More than 10 Records instead of getting 6 Records

I tried Is_Group_Changed(4 columns) in the 10 Columns Query Transform.

Its giving results more than Count of Query that doing SUM().

When I used JOIN using Is_Group_Changed and Dummy column with 1 as the Mapping value in SUM Query. Its giving wrong count of records.

is there any way to achieve this?