I have a collection of data that needs to be grouped by year. There are 6 entries in this dataset, and I want to organize them into a two-dimensional array, with 2 entries for each year...
[4711.067999999985, 12596.399999999936, 12596.399999999936, "Accessories", "2011"]
[5277939.947800145, 8912342.140000183, 8912342.140000183, "Bikes", "2011"]
[16185.937500000333, 42468.34000000009, 42468.34000000009, "Accessories", "2012"]
[11725882.954398958, 19702448.459998813, 19702448.459998813, "Bikes", 2012]
[168010.80079996982, 448815.8899998886, 448815.8899998886, "Accessories", "2013"]
[14915767.767399808, 24907912.949997608, 24907912.949997608, "Bikes", "2013"]
The desired output should be an Array like...
Array[0][0] = [4711.067999999985, 12596.399999999936, 12596.399999999936, "Accessories", "2011"]
Array[0][1] = [5277939.947800145, 8912342.140000183, 8912342.140000183, "Bikes", "2011"]
Array[1][0] = [16185.937500000333, 42468.34000000009, 42468.34000000009, "Accessories", "2012"]
Therefore, Array[0]
represents the year 2011, Array[1]
represents 2012, Array[2]
represents 2013, and so on.
Is there a way to iterate through the array and group the data by year?