#75 - Find out The Intervals in Which A Certain Condition Occurs Continuously

esProc DesktopesProc Desktop
1 min read

Problem description & analysis:

We have a statistical table for daily sales:

Task: Find out the date when the sales rises for three consecutive days or more.

Solution:

Use SPL XLL and enter the following code:

 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.

The results are as follows:


Download esProc Desktop for FREE and subscribe for more data analysis tips and tutorials!!! 🚀🔥⬇️

✨SPL download address: esProc Desktop FREE Download

✨Plugin Installation Method: SPL XLL Installation and Configuration

✨References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

✨YouTube FREE courses: SPL Programming

0
Subscribe to my newsletter

Read articles from esProc Desktop directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

esProc Desktop
esProc Desktop

esProc Desktop is a desktop data processing & analytics tool and is specifically designed for ordinary business people. It supports complex computations & spreadsheet data manipulation, can deal with tasks that are hard to accomplish in Excel, and in addition, generates more concise code than VBA and Python. esProc Desktop boasts all-around programming capabilities, supports multi-step interactive data analytics and is easy to use without configurations. This significantly lowers the technical threshold for data analytics.