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

how to obtain Sum of a formula

Status
Not open for further replies.
Jan 18, 2002
21
0
0
US
I have I'm sure an easy question: I am trying to get the SUM of a formula...
Another words.. I may have 42 instances w/in 1 group.. current formula displays summary info for each instance. I now need to give a total for all 42 instances?

Txs, J
 
Please share the formula you want to sum, and if it contains other formulas, please share those also.

-LB
 
I have 2 groups -
I have a basic Rx that simply adds 2 fields to produce a sum. Lets name this Rx "formula 1". As mentioned before, I have 42 markets that will conatin display "formula 1".

I now would like to obtain a grand total for "formula 1".

I've tried creating new Rx: Sum (formula 1) but it doesn't work.

Sorry if I'm not clear.

Txs, J
 
Don't know what "Rx" is, but if your formula {@formula1} is something like:

{table.amount1} + {table.amount2}

Then just right click on the formula (where it is placed on the report in the detail section) and choose "Insert summary"->sum.

If this doesn't work for some reason, please provide the actual formula you are using and describe your report in a little more detail.

-LB
 
I am trying to get a grand total for @formula 1.

Formula 1 = Table1 + tabel 2
--------------------------------------
My rpt looks like something like this:

Market 1
@formula 1 = xx

Market 2
@formula 1 = xx
-------------------------------------------
I need to obtain a SUM for results of formula 1?

Thanks for responding, J
 
You still are not providing the actual formula. Did you try right clicking and inserting a summary or a grand total? You have not shown anything to lead me to believe that would not work.

If the option to insert a summary is not there, then there is something in your formula that prevents it, e.g., a summary, the use of previous/next functions, whileprintingrecords, etc. That is why I keep asking what is in your formula--saying that the formula adds two tables together doesn't really make sense--are they table fields? Formulas? Summaries?

-LB
 
sorry.. here is the actuall formula:
--------------------------------------------------------
Count ({Referral.Qualified}, {Referral.Market ID}) + {CEO_YTD_GOAL.PayDateJanuary2004}

-----------------------------------------------------------
 
Okay, that was important to know. One or two more questions. Please tell us what groups you have, and where you are using the formula--is it at the detail level or at a group level, and if you have more than one group, which one is it? And do you want the summary for the whole report, and/or do you want it for a higher order group level?

-LB
 
sorry bout that..
I have it at the group level... I need to create a SUM formula that will total each groups for a grand total?

Thanks,
J
 
Try the following:

//{@accum} to be placed in the group header or footer:
whileprintingrecords;
numbervar grtot := grtot + {@yourformula};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

-LB
 
I so appreciate your help but not for sure if that works.. When I do this - should I use the formula that I want to sum when you say "@ yourformula"? If so, i place 1st in header and 2nd in footer... but I only get the 1st sum of formula.. another words it didn't add all of them?

Thanks, J
 
Place {@accum} either in the group header or footer--it doesn't matter--as long as your formula is a group level formula. Then place {@display} in the report footer (not the group footer). Yes, place the formula you want to accumulate where I say {@yourformula}. Your report should look something like this:

GH1 - 0001 //MarketID
Detail
Detail
GF1 {@YourFormula} {@Accum}
GH1 - 0002 //MarketID
Detail
Detail
Detail
Detail
GF1 {@YourFormula} {@Accum}
Report Footer {@Display}

If this isn't how you have it set up, please provide the actual design.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top