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!

Count Formula not working

Status
Not open for further replies.

koolskins

IS-IT--Management
Nov 22, 2003
79
US
Running CR10 on an Informix database. I have a need to generate a graph and report based on purchase order status over a period of time. The purchase orders either are 'closed' which is found at the header level of the PO, or else "complete" which is deduced by looking at the line items to see if payments equal commitments. I have a formula to calculate the commitmenet minus the payment at the line item level and at the PO level to determine if any remaining funds are left. If true, then the order is not complete and if the status is not closed, then the order is not part of the count at all. For every PO, I need a counter to determine how many PO's fall into the two categories during each week for a given period of time. Can someone please provide some guidance as to the correct formulas to handle the counts that can then be used to graph by? Any assistance would be greatly appreciated.

Randy
 
Sounds like you need a running total, which would add according to a formula.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Unfortunately not as the net value of the po payment verses commitment is derived from a formula and when I bring up running totals, the calculated field is not a selection option. The status field, on the other hand, could be a running total, but I can't seem to get the evaluate section correct. It needs to evaluate when the po number changes, as the lowest level of detail on the report is at the line item level, and it needs to count only those po's with status "CLOSED" and it needs to count the "CLOSED" once per po, not for every line within the po.

Randy
 
Then you'll need to use variables, which may be able to 'see' stuff a running total cannot. Here is an example of a set of variables that I used to get a page total.
Code:
Place V_head in the Page Header section and suppress it
//   Clear the total
WhilePrintingRecords;
NumberVar PageTot :=0;

Place V_Item in the whichever section contains the field you want to total
// Accumulate
WhilePrintingRecords;
NumberVar PageTot := PageTot + 1;

Place V_Show in the page footer section
// Show
WhilePrintingRecords;
NumberVar PageTot;
You'll need to adapt the idea for your own needs.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top