Hello ww, A few more details would be helpful but I'll assume a few things.
If the transaction file records contain the items numbers and received quantities in associated multi-value fields, then you need to do an exploding sort by item number, SELECT TRANSACTIONS BY-EXP ITEMNBR then in your BASIC program, total the quantity field and calculate the average each time the item number changes. You will need to handle the first record and last record in such a way that nothing is printed for the first record read and the total and average is printed after the last record is read. You will need variables to store the item number and running total so you can compare the item number with the item number for the current record. When the current item number is different than the stored item number, then print the stored item number and running total, then store the current item number and replace the total with the current quantity. If you want a grand total, then you need another variable to store it and print it out after the last record. So; process first record, printout data when item number changes replace item number and total when item changes process last record and grand total. And to make it useful, print column headings, etc. Hope this helps, Good luck. DonR On Apr 28, 5:49 pm, ww <[email protected]> wrote: > I have a data file containing transaction numbers and quantities for > items received. I need to select transactions received in the last 45 > days and then find all transactions for that same item so I can find > the total quantity received for that item. From there I can find the > 45 day average. Finding the average is the easy part! Finding the > proper records is where I'm in the dark. > > I know I need a loop within a loop but I'll be darned if I can figure > it out. I tried returning a list of transaction meeting the criteria > and then selecting and returning a list of transactions based on the > key from the first list but I don't know how I can total the quantity > from there. Maybe I'm not even on the right track. > > Any thoughts on how I might achieve this. > > Thanks in advance, > > WW --~--~---------~--~----~------------~-------~--~----~ Please read the posting guidelines at: http://groups.google.com/group/jBASE/web/Posting%20Guidelines IMPORTANT: Type T24: at the start of the subject line for questions specific to Globus/T24 To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en -~----------~----~----~----~------~----~------~--~---
