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!

Suppress a running total resutls once it reaches a value 1

Status
Not open for further replies.

up4a

Technical User
Apr 27, 2010
19
US
I am working on a report that lists items with the qty hand, then it has a running total of the most recent receipts that I want to stop returning records on the receipt that brings the running total to equal or greater than the qty on hand. Open to any suggestions; sample data;

item qty_on_hand receipt_dt Receipt_qty Total_Received
1001 199 5/25/2018 10 10
1001 199 3/26/2018 1000 1010
1002 191830 2/11/2019 60000 60000
1002 191830 12/26/2018 1055 61055
1002 191830 12/14/2018 100000 161055
1002 191830 5/25/2018 778 161833
1002 191830 4/27/2018 30000 191833
1003 600 9/29/2018 1000 1000

So once the running total reaches the current qty on hand it stops returning receipt records.

Thanks Tek-Tips!
 
Create a formula for the running total and place it in the detail section:

whileprintingrecords;
numbervar amt;
numbervar prevamt := amt;
if not onfirstrecord and
{table.itemID}<>previous({table.itemID}) then
amt := 0;
amt := amt + {table.receiptqty};

Then go into the section expert->details->suppress(do not check)->x+2 and enter:

whileprintingrecords;
numbervar prevamt;
prevamt > {table.qtyonhand}

-LB
 
lbass to the rescue! Worked like a charm.

Thank you so much.

~up4a
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top