Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Selecting maximums Post Reply Post New Topic
Author Message
ChzHdGrrl
Newbie
Newbie
Avatar

Joined: 07 Mar 2012
Online Status: Offline
Posts: 10
Quote ChzHdGrrl Replybullet Topic: Selecting maximums
    Posted: 07 Mar 2012 at 7:22am
I'm not new to Crystal, but I have just recently returned to it after a number of years and having to relearn it on my own has fried my brain. Thanks to Brian and all else who manage and use this forum....it's a huge help.
 
I'm putting summary information in a report footer and am struggling with my last two summaries. I need to display the content of a name field where the content of a number field is the maximum in the result set. I'm working off a SQL view I wrote specifically for this report.
 
The logic is like this: where {table.field} is the maximum in the result set, print {table.field} in the footer.
 
I'm sure this is a really stupid question....
 
Thanks!
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 07 Mar 2012 at 7:52am
that would be a formula like
if  {table.field} = maximum({table.field}) then {table.field}

then go to sort expert  and put
{table.field} into it as descending
IP IP Logged
ChzHdGrrl
Newbie
Newbie
Avatar

Joined: 07 Mar 2012
Online Status: Offline
Posts: 10
Quote ChzHdGrrl Replybullet Posted: 07 Mar 2012 at 9:30am
I did some more research and found that my problem is trying to use aggregate functions in my record selection. I need to look at Add Command.
 
Still trying!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Apr 2012 at 5:59am
You can use variable fomrula or Running Totals to display the contnet in the footer.
I prefer RTs
New RT
name=Max_Name
field to summarize=namefield
type=maximum
evaluate=use a formula
table.numberfield=maximum(table.numberfield)
reset=never
place in report footer
 


Edited by DBlank - 26 Apr 2012 at 6:19am
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.020 seconds.