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!

Summarize Inquiry

Status
Not open for further replies.

jaisol

Programmer
Apr 27, 2001
7
US
I would like to summarize the next formula:
@Total = {@Formula1} + {@Formula2}

Basically the detail section is:
Item Desc Field1...FieldN Total
{Tab.Itm} {Tab.Desc} {@Total}

... where some result could be:
Item Desc Field1 ... FieldN Total
1 Prod1 ... ... 30
3 Prod3 ... ... 25
5 Prod5 ... ... 50

Note that the missing registers (items: 2, 4) really exist into the table but they are not showed because not comply with some conditions.

I tried with a variable and three formulas:
@ResetTotal (into Page Header)
WhilePrintingRecords;
Numbervar MySum:=0;
@CalcTotal (into Details section)
WhilePrintingRecords;
Numbervar MySum:=MySum + {@Total};
@PrintTotal (into Page Footer)
WhilePrintingRecords;
Numbervar MySum;

.. but the variable MySum summarized the @Total formula for all the registers including the items 2 & 4.

How could I resolve that?

I really appreciate any response. THANKS!
 
the answer is in
"but they are not showed because not comply with some conditions."
Change your formula
//@CalcTotal (into Details section)
WhilePrintingRecords;
Numbervar MySum ;
If (whatever those conditions are) then MySum := MySum + {@Total}
Else
Mysum ;
Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Sure I did it but the results were the same.

The @Total formula definition call two formulas ({@Formula1} + {@Formula2}) and
the definitions of these formulas include conditions+other formulas and these other
formulas call others formulas too.

I don't know if this use of formulas is the reason for the wrong result.

Some else suggestion. THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top