In my dataset, I have JSON files containing information spanning from the year 2008 to 2020, along with additional data keys like location and name:
{"2008": 50, "2009": 60, "2010": 70, "2011": 80, etc...}
My goal is to organize these years into a new key and include it in the existing array:
{metric:
[{"year": 2008, "perc": 50},
{"year": 2009, "perc": 60},
{"year": 2010, "perc": 70},
{"year": 2011, "perc": 80}],
"2008": 50,
"2009": 60,
"2010": 70,
"2011": 80,
etc...
}
To accomplish this, I believe I need to establish a range between 2008 and 2020. If any keys fall within this range, they should be added to the metrics
group and included in the array.