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!

Crosstab grand totals substraction formula help

Status
Not open for further replies.

sara07

Programmer
Feb 4, 2008
23
US
I have a crosstab that look like this:

(Credit card type) By Charge Return Totals
AMEX 1000 500 1500
VISA 2000 600 2600
MC 3000 400 3400
Totals 6000 1050 7050

I would like to get a row which substracts 6000 - 1050 = 4950. Substracting grand totals from by charge and return.

I was not able to do this. This is on my report footer. I created a formula:
maximum(transactionamount,transactioncode) - minimum(transactionamount,transactioncode)

This gives me 3 values of difference in the transaction code but when I try to edit this formula to have summary:
maximum (Sum({transactionamount,transactioncode})) - minimum(Sum({transactionamount,transactioncode}))
It says this field cannot be summarized.

Either case I just want to simply subtract grand total (By Charge) - grand total ( Return) or by using the formula.

Please help how can i acheive this by either case?

Your help will be appreciated.


 
If this is a manual crosstab, then you have formulas like this:

//{@ByChg}:
if {table.column} = "By Charge" then {table.amt}

//{@Return}:
if {table.column} = "Return" then {table.amt}

Your formula should then be:

sum({@ByChg})-sum({@Return})

If you are not using a manual crosstab, you should be, as it is much simpler in this case. You would just insert a group on credit card type, and then place the above two formulas in the detail section and insert sums on them at the group level. Then suppress the detail section, drag the groupnames into the group footer. Then add the grand total formula into the report footer.

-LB

 
Thank you so much LB! I wasted all of my day yesterday trying to do this. But today morning I was happy to get your help!

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top