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

calculating diference between between sub totals of groups

Status
Not open for further replies.

addygoyal

Programmer
Apr 24, 2003
21
ZA
guys you gotta help me with this

there are two groups which i ve got by using group by some field so it is like
Group1 3450.00
3456.00
3487.00
Subtotal1 10393.00
Group2 3550.00
3456.00
3687.00
Subtotal2 10693.00

i want difference between subtotal1 and subtotal2 i.e.(subtotal1 - subtotal2) to be displayed

So got any solution
 
I'd suggest a pair of running totals, derived using the same rules as the two subtotals.

Madawc Williams
East Anglia, Great Britain
 
Will you only have 2 subtotals all the time? If so, you could do the following:

1. Create the following formula and place it in the RH section:

booleanVar FirstTimeThrough := True;

2. Create another formula, add the following text, and place it in the Group Footer section:

booleanVar FirstTimeThrough;
numberVar Value;

If FirstTimeThrough = True then
Value := Sum ({Field}, {GroupingField})
Else
Value := Value - Sum ({Field}, {GroupingField});

FirstTimeThrough := False;

Value;

3. Right Click the second formula and conditionally suppress with the following text:

GroupNumber = 1


~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top