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

Summing Negative and Positive Values

Status
Not open for further replies.

wakthar

Programmer
Jul 27, 2007
14
GB
Hi,

I have an accounts report which has two columns called Dispute and Income. These two report columns refer to one singe database field called incomevalue (numeric(18,2) field).
The report is grouped by region and contract and I need to sum up all the negative incomevalues and show them under Dispute and positive values under Income.

I have tried using a formula field with the following in the details section which is suppressed as I dont want to show anything in that section.
The formula has the following

numberVar negValues;
numberVar posValues;

if ({cew.cew_incomevalue} < 0.0)
negValues=negValues+{cew.cew_incomevalue};

if ({cew.cew_incomevalue} > 0.0)
posValues=posValues+{cew.cew_incomevalue};


In GF2 section I have another 2 formulas which I was hoping would show the totals, Dispute and Income.
The code for Dispute is as follows:

numberVar negValues;
negValues;

The code for Income is similar.

In the RF I need to a grand total for Dispute and Income.


Thanks in advance



 
What does "sorted" mean? This was not a sorting question. Did you figure this out?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
I'm guessing the issue was that the formulas needed: "whileprintingrecords;". Also, a reset formula would be necessary in the GH2 header.

wakthar,

As Don notes, you should explain your solution so that others may benefit from the thread.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top