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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manual Running Total blues

Status
Not open for further replies.

edsaf

MIS
Mar 25, 2008
16
AU
Hello,

Using CR-XI on a SQL database.

I need to dsplay the team with the highest score. I am unable to use the group sort expert because of the way the score is generate so i have used the reset/evaluate/display method, and it works (for the result).

The problem i have is that i need to display the team name that is associated with the highest score.

-----------------------------------------
Here are my current formula's:

-reset-
whileprintingrecords;
global numbervar nps_site:= -999;

-evaluate-
whileprintingrecords;
global numbervar nps_site;

if {@nps_site} > nps_site then nps_site:= {@nps_site} else nps_site

-display-
whileprintingrecords;
global numbervar nps_site;

nps_site

-----------------------------------------
For the team name, i tried doing this, but i keep getting blank results:

-reset-
whileprintingrecords;
global stringvar site_name:= ''

-evaluate-
whileprintingrecords;
global numbervar nps_site;
global stringvar site_name;

if {@nps_site} > nps_site then site_name:= GroupName ({@site}) else site_name


-display-
whileprintingrecords;
global stringvar site_name;

site_name

Whats the best way to get the team name??

 
i would drop the groupname function and just refer to the database field that holds the name.

Also, there is no need to use "global" in these formulas, all variables are global unless declared otherwise.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
You should identify the groups and the placement of each formula. Assuming you are looking for results at the Group #1 level, then you could use just one evaluation formula like this:

whileprintingrecords;
numbervar nps_site;
stringvar site_name;
if {@nps_site} > nps_site then (
nps_site:= {@nps_site};
site_name := {@site}
);

Use the reset and display formulas that you showed earlier.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top