I have an extremely large data set by day for the last 6 months. I want to count the number of consecutive days where there was an increase in bill volume for the purpose of identifying the largest streak.
For example, we continuously increased bill counts from January 1st through January 5th I want to return 5 days. There was another upward trend over consecutive days from January 10th through January 17th, I want to return 7 days. The ultimate goal is to identify what date range had the most consecutive days with a trend of increasing bill counts.
Additionally, I want to calculate the reverse to identify how many consecutive days we had a trend of decreasing bill count.
Does anybody have any suggestions on the most efficient way to calculate this?
[TABLE="class: grid, width: 1195"]
<tbody>[TR]
[TD]Client Name[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[/TR]
[TR]
[TD]Process Date[/TD]
[TD="align: right"]1/1/2019[/TD]
[TD="align: right"]1/2/2019[/TD]
[TD="align: right"]1/3/2019[/TD]
[TD="align: right"]1/4/2019[/TD]
[TD="align: right"]1/5/2019[/TD]
[TD="align: right"]1/6/2019[/TD]
[TD="align: right"]1/7/2019[/TD]
[TD="align: right"]1/8/2019[/TD]
[TD="align: right"]1/9/2019[/TD]
[TD="align: right"]1/10/2019[/TD]
[TD="align: right"]1/11/2019[/TD]
[TD="align: right"]1/12/2019[/TD]
[TD="align: right"]1/13/2019[/TD]
[TD="align: right"]1/14/2019[/TD]
[TD="align: right"]1/15/2019[/TD]
[TD="align: right"]1/16/2019[/TD]
[TD="align: right"]1/17/2019[/TD]
[/TR]
[TR]
[TD]Total Bill Count[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD]Consecutive Trend Increase[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Consecutive Trend Decrease[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]
For example, we continuously increased bill counts from January 1st through January 5th I want to return 5 days. There was another upward trend over consecutive days from January 10th through January 17th, I want to return 7 days. The ultimate goal is to identify what date range had the most consecutive days with a trend of increasing bill counts.
Additionally, I want to calculate the reverse to identify how many consecutive days we had a trend of decreasing bill count.
Does anybody have any suggestions on the most efficient way to calculate this?
[TABLE="class: grid, width: 1195"]
<tbody>[TR]
[TD]Client Name[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[TD]Client A[/TD]
[/TR]
[TR]
[TD]Process Date[/TD]
[TD="align: right"]1/1/2019[/TD]
[TD="align: right"]1/2/2019[/TD]
[TD="align: right"]1/3/2019[/TD]
[TD="align: right"]1/4/2019[/TD]
[TD="align: right"]1/5/2019[/TD]
[TD="align: right"]1/6/2019[/TD]
[TD="align: right"]1/7/2019[/TD]
[TD="align: right"]1/8/2019[/TD]
[TD="align: right"]1/9/2019[/TD]
[TD="align: right"]1/10/2019[/TD]
[TD="align: right"]1/11/2019[/TD]
[TD="align: right"]1/12/2019[/TD]
[TD="align: right"]1/13/2019[/TD]
[TD="align: right"]1/14/2019[/TD]
[TD="align: right"]1/15/2019[/TD]
[TD="align: right"]1/16/2019[/TD]
[TD="align: right"]1/17/2019[/TD]
[/TR]
[TR]
[TD]Total Bill Count[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD]Consecutive Trend Increase[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
[TR]
[TD]Consecutive Trend Decrease[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[/TR]
</tbody>[/TABLE]