11.11 Group by interval of data values

 

Here below is a data table:

imagepng

The task is to put every 5 days in a group, and calculate the average of the values in each group:

A
1 =E(‘A1:B19’)
2 =A1.Date
3 =A1.group@i(if(Date-A2==5,(A2=Date,true),false))
4 =A3.new(Date,~.avg(Value):Avg)

imagepng

A2: Let the start variable of loop be the Date of the first row.
A3: Put every 5 days in a group.
A4: Calculate the average of the values in each group, and the Date means the first date of each group.


esProc Desktop and Excel Processing
11.10 Group when meeting non-null value
11.12 Concatenate data within group into text