Getting the values of the maximum record

user3242003 picture user3242003 · Jan 27, 2014 · Viewed 9.2k times · Source

I am facing some difficulties while developing a report. The problem is that I am getting a number of values in the Details section and I want only to display the record which it is having the maximum event number for each group (one record to be shown for each group). My report structure is:

GH1:{Deal_NO} 1 -- Suppressed

Details:{Deal_NO} {Amount} {Event_no} {Comments}

1 1000 222 Rate

1 2345 655 Principal

1 444 111 Sell

GF1: {Deal_NO} -- Suppressed

So, my result should be:

1 2345 655 Principal

So, please instruct me on how to do that. I tried to define in the Group Selection under Select Expert: {Event.Event_no}=maximum({Event.Event_no},{Deal_No}), but some deals were disappeared.

Answer

Ryan picture Ryan · Jan 27, 2014

You can't use that logic with record or group selection. Instead, use the logic you have but use it to suppress the Details Section. So,

//Suppress Details if the current record is not the record with the
// maximum amount for the group
{Event.Event_no}<>maximum({Event.Event_no},{Deal_NO})

Now, when you run the report every record will be suppressed except for the one with the maximum amount per group.