Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sum of Amount based on filter on other field

I am trying to create a report where sum of amount would be displayed in 3 different columns based on what is in EDLCode field.


If EDLCode IN (501,502,503) Then Sum(Amount) in Column1

If EDLCode IN (505,506) Then Sum(Amount) in Column2

If EDLCode IN (1500) Then Sum(Amount) in Column3

Let me know if this makes sense. I am getting the report to work when I put fields in detail section but I need only one line per employee, so I am using Group Header and it shows 0 in column 2 and 3.

Final data should look like:

EmployeeName Column1 Column2 Column3

My ultimate aim is to concatenate all this fields in 1 field and be able to send as fixed width file.

Former Member

Hi Parag,

Here's what you need to do:

1) Create a formula (@Column1) with this code:

If {EDLCode} IN [501,502,503] Then {Amount}

2) Go to Insert Summary > choose the formula field from the list as the Field to Summarize > Choose 'Sum' as the summary operation > Under Summary Location choose the correct Group and click OK

3) Repeat steps 1 and 2 for the other two columns however, make sure you change the EDL codes for each formula.

You can also do this via the Running Total Option however you won't be able to place the sum on the Group Header, it works only on the Group Footer.


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question