All2Cheesy
Board Regular
- Joined
- Mar 4, 2015
- Messages
- 127
Hi all,
I'm looking to create a count for the number of successive increases or decreases in my data set.
I'm not sure if this can be done, and I'm struggling to think of a way to get started on this. Would anyone have any suggestions? Example is below.
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[/TD]
[TD]April
[/TD]
[TD]May
[/TD]
[TD]June
[/TD]
[/TR]
[TR]
[TD]Company 1
[/TD]
[TD]$150
[/TD]
[TD]$200
[/TD]
[TD]$300
[/TD]
[/TR]
[TR]
[TD]Company 2
[/TD]
[TD]$400
[/TD]
[TD]$200
[/TD]
[TD]$30
[/TD]
[/TR]
[TR]
[TD]Company 3
[/TD]
[TD]$400
[/TD]
[TD]$300
[/TD]
[TD]$600
[/TD]
[/TR]
</tbody>[/TABLE]
Company 1 should return +3 (Because it ended with 3 successive increases)
Company 2 should return -3 (Because it ended with 3 successive decreases)
Company 3 should return +1 (Because it ended with 1 increase)
I'm looking to create a count for the number of successive increases or decreases in my data set.
I'm not sure if this can be done, and I'm struggling to think of a way to get started on this. Would anyone have any suggestions? Example is below.
[TABLE="width: 500"]
<tbody>[TR]
[TD]
[/TD]
[TD]April
[/TD]
[TD]May
[/TD]
[TD]June
[/TD]
[/TR]
[TR]
[TD]Company 1
[/TD]
[TD]$150
[/TD]
[TD]$200
[/TD]
[TD]$300
[/TD]
[/TR]
[TR]
[TD]Company 2
[/TD]
[TD]$400
[/TD]
[TD]$200
[/TD]
[TD]$30
[/TD]
[/TR]
[TR]
[TD]Company 3
[/TD]
[TD]$400
[/TD]
[TD]$300
[/TD]
[TD]$600
[/TD]
[/TR]
</tbody>[/TABLE]
Company 1 should return +3 (Because it ended with 3 successive increases)
Company 2 should return -3 (Because it ended with 3 successive decreases)
Company 3 should return +1 (Because it ended with 1 increase)