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!

Summing Like Input Line Items into output

Status
Not open for further replies.

ChrisHallJJ

Programmer
Jul 25, 2003
27
US
I have a need to produce a standard EDI 810 (Invoice) document.

My problem is as follows:
My input file has detail records unique by UPC. Also contained in these records is a Catalog number, which is used by my client and not unique. My client requires that I roll the EDI output details together using their Catalog number. Currently, my functional map always writes one line per detail. I do not know how to read thru the details, find the like records, sum the qty of these like records, and then write the detail out only when all of the records have been summed. Please help!!!
Chris

e.g.
Input: ----UPC------ Qty Catalog
000002D16681151111111111111..001....500......444111
000003D16681152222222222222..005....200......444222
000002D16681153333333333333..002....500......444111
000003D16681154444444444444..003....200......444222

Required output:
IT1**3*EA*5.00**IN*444111...............
IT1**8*EA*2.00**IN*444222...............

Current Output:
IT1**1*EA*5.00**UP*1111111111111........
IT1**5*EA*2.00**UP*2222222222222........
IT1**2*EA*5.00**UP*3333333333333........
IT1**3*EA*2.00**UP*4444444444444........
 
Well - I am guessing that you will need to fit this syntax into your rules somewhere..having used the UNIQUE FUNCTion At a higher level - pass that down to be a second argument)

SUM(EXTRACT(FIELD TO SUM.......... WHERE UNIQUE FIELD NAME AT RECORD LEVEL= UNIQUE FIELD PASSED DOWN FROM FUNCY MAP)

 
Ekimr,
Thank you so much.....I was able to accomplish what I needed to!!!
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top