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

Summing Variables

Status
Not open for further replies.

calvinsmith

Programmer
Nov 3, 2004
6
US
I have a formula that I would like to sum the values of the variables to give me a total number. This is what I am using so far:

Code:
if {Plants000.SPECIES} = "ferocactus wislizenii" and {Plants000.DISPOSITIO} = "pip" and {Plants000.HEIGHT} > 2 then
    numbervar fwislizeniigreater2 := 1
else
    numbervar fwislizeniigreater2 := 0;

//sum(fwislizeniigreat2) //This will not work because it
                         //not a field

//This is where I need to sum the values.
//If I create a new formula, I can sum this formula but,
//I would like to do multiple sums on this formula to be
//used at the end in one big forumla.

//Any help would be greatly appreciated!
 
Instead use:

if {Plants000.SPECIES} = "ferocactus wislizenii" and
{Plants000.DISPOSITIO} = "pip" and
{Plants000.HEIGHT} > 2 then
1 else 0

Then you can right click on this formula and insert a summary (sum).

-LB
 
lbass,

Where exactly would I be right-clicking to insert the summary? Would this be in the current formula or in a new formula? If the answer is the latter, I need to be able to perform the summary within the same formula. Is this possible?

Thanks for the help!

Cal
 
The formula above is a detail level formula (let's call it {@plants}. You can either place it in the detail section and then right click on it->insert summary->sum, or, you can create a second formula:

sum({@plants}) //for a grand total, or:

sum({@plants},{table.group}) //for a group total

The grand total formula can be placed in the report footer or anywhere on the report and still retain the correct value. The group total can be placed in the detail section or a group header or group footer section and it will display the correct value for the group.

If this isn't what you're looking for, perhaps you should explain what you mean by "I need to be able to perform the summary within the same formula" and also explain why.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top