11.11 Group by interval of data values
Here below is a data table:
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) |
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.
https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1657157948145
https://c.scudata.com/article/1657247950044
SPL Official Website 👉 https://www.esproc.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.esproc.com
Discord 👉 https://discord.gg/2bkGwqTj
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/