Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 8.5 - Selecting 2 maximum fields 1

Status
Not open for further replies.

kj27

Programmer
Mar 16, 2010
30
US
I'm having trouble with a relatively simple report using version 8.5.

The table structure briefly explained:

The report selects certain accounts meeting a criteria. For each account, there can be 0 to many Opportunities.

For each Opportunity, there can be 0 to many Previous Activities (stored in the History table) and 0 to many Upcoming activities (stored in the Activities table).

So I have the main report listing Account details and a sub-report listing all associated Opportunities.

In the sub-report, I have grouping done by Opportunity Description (which is actually the Opportunity Name)

Then I have the the group selection formula set as:

{HISTORY.COMPLETEDDATE} = Maximum({HISTORY.COMPLETEDDATE},{OPPORTUNITY.DESCRIPTION});

Is there a way to also pull in the Next Activity Date:

{ACTIVITY.STARTDATE} = Maximum({ACTIVITY.STARTDATE}, {OPPORTUNITY.DESCRIPTION});

Or some alternative?

Thanks
 
Before applying the group selection sort your records by completeddate in descending order and then by startdate in descending order. Check to make sure that the most recent complete date and startdate appear in the first row of each group. If they do (and they should), you can copy the detail row into the group header and suppress the detail section. You could alternatively apply the group selection and the most recent startdate should appear in the group selected record because of your sorting.

-LB
 
Hi lbass,

Thanks a lot for the help. I followed the steps for post-group sorting and the most recent data showed up correctly in the header. I'll make a copy of the report and attempt the first idea also.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top