crystal-reportscrystal-reports-xi

Getting the values of the maximum record


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 is having the maximum event number for each group (one record to be shown for each group).

My report structure is:

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 have disappeared.


Solution

  • 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.