Posting this again as I’ve made some updates.
I’m trying to group a set of values, but I only want to display the values if there was a change.
Imagine that the value is fluctuating, ranging from 1, to 4, to 3, to 1, to 1 and to 1 again.
Some example data
value | date_loaded |
1 | 2012-03-07 |
1 | 2012-03-06 |
1 | 2012-03-05 |
3 | 2012-03-04 |
4 | 2012-03-03 |
1 | 2012-03-02 |
I want to display each of the values in order of which they fluctuated, but group them together. So you would only see in order, 1, 4, 3, 1, rather then the three 1’s most recently.
So I would like to display the latest value, with it’s earliest date, e.g.
value | date_loaded |
1 | 2012-03-05 |
3 | 2012-03-04 |
4 | 2012-03-03 |
1 | 2012-03-02 |
What is the best way to go about this? Would it be possible to do an if statement? If value 1 is different to value 2, +1 to “change” ? Therefore I’d be able to group the values by “change1”, “change2” etc.?
How about: