that is not really a weighted average as I understand it...but that is fine if that is what you are looking for.
A weighted average would apply more emphasis on on-time deliveries on busy days relative to not so busy days.
OK so now I know what you are looking for let us tackle the problem at hand...the result you want is actually easier to do.
What we will do is simply create 2 arrays one for total shipments/day and the other for on-time shipments that day.
Then we will treat them like a conveyor belt and drop off the oldest data at one end and add a new data at the other
********************************************************
@Initialization (placed suppressed in group header
prior to the group for "day"

WhilePrintingRecords;
//initialize to 15 elements...one per day
if not inrepeatedGroupHeader then
(
numberVar array TLShip := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numberVar array OTShip := [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
numberVar DayCount := 0;
);
********************************************************
@CalcAverages (detail Section - may or may not suppressed )
WhilePrintingRecords;
numberVar array TLShip ;
numberVar array OTShip ;
numberVar DayCount ;
numberVar TotalShip := 0;
numberVar TotalOnTime := 0;
numbervar AVG_OnTime;
Numbervar WtAVG_OnTime;
numbervar m;
DayCount := Daycount + 1;
for m := 14 to 1 step -1 do
(
TLShip[m+1] := TLShip[m];
OTShip[m+1] := OTShip[m];
);
TLShip[1] := {Table.TotalShipments};
OTShip[1] := {Table.OnTimeShipments};
for m := 1 to 15 do
(
TotalShip := TotalShip + TLShip[m];
TotalOnTime := TotalOnTime + OTShip[m];
);
AVG_OnTime := TotalOnTime / 15;
WtAVG_OnTime := TotalOnTime / TotalShip;
you can now display these values in this formula or create an additional formula for display and suppress this one
Use DayCount variable to conditionally suppress the averages (either the entire section or specific formulas)until the total is greater than or equal to 15.
Hope this helps Jim Broadbent