cancel
Showing results for 
Search instead for 
Did you mean: 

BEX Query Designer: Top N or Maximum sale based on two characteristics

0 Kudos

Hi,

I want to calculate the Top N or maximum sale per contract and UNSPSC Code. I'm not sure how to do this in BEx Query Designer.

My data is:

Contract; UNSPSC code; Sale

4700000014; 42181605; 100095,7

4700000014; 42181500; 43794

4700000014; 42181801; 31375

4700000014; 41112212; 18000

4700000014; 42181602; 12134

4700000014; 73171602; 10114

4700000026; 42291613; 258677,88

4700000026; 42291621; 8140

4700000026; 42182413; 2134,96

4700000026; 42291606; 1201,1

The end result should be the maximum sale based on UNSPSC code per Contract:

Contract; UNSPSC code; Sale

4700000014; 42181605; 100095,7

4700000026; 42291613; 258677,88

Best regards

Morten

Accepted Solutions (0)

Answers (1)

Answers (1)

jyothirmayee_s
Active Contributor

Hi,

Try Condition option in BEx query designer.

Select new condition >> select attribute you want Top N >> set value for Top N (number). by default the new condition will be active.

Query should show only Top N records.

Thanks,

Jothi