Hello everyone, in order to create diagrams to compare the values of this year with those of last year, I have written this Arcade code. However, I am unable to sort it in ascending order. Do you have any ideas?
var features = FeatureSetByPortalItem(
Portal('#####'),
'#####',
0,
['#####', '#####'],
false
);
//var aa=Filter(features,' ')
var current_Year = ISOYear(today());
var ago_Year= ISOYear(today())-1;
var dict = {
fields: [
{ name: "month", type: "esriFieldTypeString" },
{ name: "Year", type: "esriFieldTypeString" },
],
geometryType: "",
features: [],
};
var index = 0;
for (var featu in features) {
dict.features[index] = {
"attributes": {
"month": Text(ISOMonth(featu["Date_de_clôture_technique"])),
"year": Text(ISOYear(featu["Date_de_clôture_technique"])),
}}
index++;}
console(dict)
var res = GroupBy(FeatureSet(Text(dict)), ['month', 'year'],
[{name: 'insp_by_month', expression: '1', statistic: 'COUNT'}])
return res