Skip to Content
0
Feb 18, 2011 at 03:24 PM

BEX Query returning first n rows for a characteristic

201 Views

Hi, I am designing a simple query. Infoprovider has customer and payment date as characteristic, and amount payed as key figure.

The actual query lists all the payments, for each customer, in descending date order.

I would like to show only the last n payments (for example the last 6 payments for each customer). I have created another column for the 'amount' index, setting calculation as 'counter'. It correctly numbers all the rows from 1( the last date) to n (the older date). If I try to set up a threshold condition on this column (e.g.. value <= 6), it doesn't work; actually it doesn't filter the rows after the sixth.

Any suggestion?

Thanks

Massimo