# Thread: odd total function required

1. ## odd total function required

hi again:

i have a report of revenue and expenses. the report displays totals from the chart of accounts as well as the account number (type is actually character with numeric entries). the last account in revenue is "4999" which is a total of all revenues. the last account in expenses is "5999" which is the total of all expenses.

how can i place a calculated field on a report that will display the revenue (acct"4999") minus the expenses (acct"5999")? this should be an easy one, but it eludes me at the time.

regards,

ed

2. ## RE: odd total function required

Ed, do you want the report to recalc the totals for both, and then show the difference... i.e. as a means of cross checking your data ?

If not, why not store the precomputed revenue and expense totals in variables and pass them to the report layout at print time ?

-- tom

3. ## RE: odd total function required

hi tom:

thank you!

couldn't see the forest for the trees.

thanks again! happy happy joy joy

best regards,

ed

4. ## RE: odd total function required

I'm not sure how you keep your data, but if debit and credit amounts are both kept basically as positive amounts with the type determining if it is a debit or credit, try a calculated field spmething like like the following assuming "3" is Income and "4" is expenses:

glamount: IF(type = "3",-glamount,IF(type = "4",glamount,0))

This will behave like any other field on a record, and you can create subtotals or grand totals on this field. Grand total should be the profit loss amount.

5. ## RE: odd total function required

hi john:

the structure of the application unfortunately would not support your approach. i had been away from programming for a while and got muddled by taking the wrong approach and continuing to persue it as opposed to standing back and being more objective. you'd think that after decades of coding i would be past that stage ... oh well...

thanks again, any help is always appreciated!

regards,

ed

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•