Thanks all. I agree that it would be really handy if the UniVerse technique worked in UniData, but it is hardly surprising that it doesn't. It is equally surprising that an alternative is not available, but, then again, why haven't I felt the absence of such a function more keenly in the 17 years I have been working with UniData..... Cheers, Kebbon
> Date: Thu, 23 Jul 2009 10:17:08 -0700 > From: [email protected] > To: [email protected] > Subject: Re: [U2] FW: Running total from UniData dict > > As long as we're on the subject, how about a running average? > > [running average] = [running total] / [number of items so far] > > @NI is the item counter as the LIST command proceeds. > Using any of the methods discussed so far to get the running total, > divide by @NI: > > > DICT ORDER.DETAIL RUNAVG > 01: I > 02: (QTY + @1); @ / @NI > > Or Brian's: > > 01: I > 02: SUBR('RT','RUNNING_TOTAL',UNITS); @ / @NI > > > > SORT ORDER.DETAIL BY ORDER.DATE _ > ID-SUPP NI @ID ORDER.DATE TOTAL QTY RUNTOT RUNAVG > > NI... ORDER..... Order... Qty. RunTot. RUNAVG.... > DETAIL.... Date.... Example > > 1. 10004_1 12/28/99 704 704 704.00 > 2. 10007_1 01/12/00 301 1005 502.50 > 3. 10005_1 01/15/00 502 1507 502.33 > 4. 10001_2 01/23/00 418 1925 481.25 > 5. 10002_1 01/24/00 605 2530 506.00 > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
