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

P&L Formula

Status
Not open for further replies.

Croaks

Programmer
Jun 29, 2004
26
GB
Hi

Im trying to create a simple formula from two tables that deducts one catagory total from another but i cant get it working, thjis is what ive come up with so far but i think im well off

Sum ({SandPTransactions.NETAMOUNT}, {NominalCodes.TYPE}, "Sales") - ({SandPTransactions.NETAMOUNT}, {NominalCodes.TYPE}, "Purchase")

help please

Croaks


 
What Crystal? In 8.5, I'd create running totals and then subtract one running total from the other.

Madawc Williams (East Anglia)
 
The "condition" clause in group summary functions is only for dates, so that you can specify daily, monthly, etc. If you don't have duplicate data, you could create two formulas:

//{@sales}:
if {NominalCodes.TYPE} = "Sales" then {SandPTransactions.NETAMOUNT}

//{@Purchases}:
if {NominalCodes.TYPE} = "Purchases" then {SandPTransactions.NETAMOUNT}

You can then right click on each of these and insert a summary (sum). To get the difference, use:

sum({@sales}) - sum({@purchases})

If you are using a group, e.g., on Account ID, then use:

sum({@sales},{table.acctID}) - sum({@purchases},{table.acctID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top