Displaying distinct values in a column filtered on other column in SAP BO report

There are multiple ways to display distinct values in a column filtered on other columns in SAP BO reports. The two most common approaches are using count variables and the PREVIOUS() function.

Method 1: Using Count Variable

The first method involves creating a variable that counts distinct occurrences based on a grouping column −

Terms Count = Count([Terms Code]) in ([Sales #])

Add this variable to your report structure. The variable will display 1 for all records with Sales # 1000 and 2 for all records with Sales # 1001, effectively counting distinct terms per sales number.

To filter and show only records with multiple terms, apply a filter condition −

Count > 1

This filter will display only sales numbers that have more than one distinct payment term associated with them.

Method 2: Using PREVIOUS() Function

The second approach uses the PREVIOUS() function to compare values across rows based on specified dimensions −

Previous([Payment Terms Code]; ([Sales #];[Line #]))

This function returns the previous value of Payment Terms Code when the data is sorted by Sales # and Line #. By comparing the current value with the previous value, you can identify when terms change within the same sales context.

You can then create additional logic to flag distinct values by comparing the current [Payment Terms Code] with the result of this PREVIOUS() function.

Both methods provide effective ways to identify and filter distinct payment terms within your SAP BO reports, with the count method being simpler for basic filtering and the PREVIOUS() function offering more granular control over row-by-row comparisons.

Updated on: 2026-03-13T20:40:20+05:30

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements