6.13 Find out interval in which a certain condition occurs continuously
We have a statistical table for daily sales:
Find out the date when the sales rises for three consecutive days or more:
A | |
---|---|
1 | =0 |
2 | =E(‘A1:B32’).group@o(if(Sales>Sales[-1], A1,A1=A1+1)).select(~.len()>=3).conj() |
A2: Take A1 as a temporary value. A1 remains unchanged when the sales rises, and plus 1 when the sales falls, and then group according to this temporary value. In this way, the rows of consecutive rise are put into the same group.
https://c.scudata.com/article/1651916536524
https://c.scudata.com/article/1654391240951
https://c.scudata.com/article/1654480004413
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/