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

Help with Crystal Formula

Status
Not open for further replies.

cis12232004

Technical User
Apr 13, 2005
57
BS
I am attempting to total a field in a report but the values comprising that field can either be positive or negative and when I use this formula:

WhilePrintingRecords;
If IsNull (Sum ({@TSiteQtySet}, {vr_10630.SiteId}))
Then
{@RptBegQty}
Else
{@RptBegQty} - sum ({@TSiteQtySet}, {vr_10630.SiteId})

it isn't really accurate. How can I amend this formula so that it takes positive numbers number into the calculation?
 
Why do you say it doesn't take positive numbers into the calculation? If you are getting unexpected results, please post sample data, the results you are getting, and the expected results.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Since you didn't post what {@TSiteQtySet} or {@RptBegQty} is, how could anyone know?

Crystal sums positive and negative fine, there's something else here amiss.

-k
 
{@TSiteQtySet} represents the total number of stock in two warehouses and {@RptBegQty} represents the quantity on hand at the beginning of the period.

Thinking that when calculating since basic math says a positive and a positive = addition and a negative and positive = subtraction, I thought the "else" of my formula would then generate the correct figures but it doesn't. When a shipment comes in and is added to the total stock in the warehouse, it is still subtracting that figure even though it is positive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top