Hello from Sweden
I want to make a histogram of values in a table between null to 500.
I have made an arcade expression earlier to be able to sort by category and I have tried to change that one to this:
var features = [];
var feat;
for (var f in fs){
var d = Decode(
f['VAR27'],
9, '1-10',
29, '20-30',
54, '50-60',
79, '70-80',
''
)
feat = {
attributes: {
formelltNamn2023: f['formelltNamn2023'],
histogram: d,
AR: f['AR'],
VAR27: f['VAR27']
}
}
Push(features, feat)
}
var out_dict = {
fields: [
{name: 'formelltNamn2023', type: 'esriFieldTypeString'},
{name: 'histogram', type: 'esriFieldTypeString'},
{name: 'VAR27', type: 'esriFieldTypeInteger'},
{name: 'AR', type: 'esriFieldTypeInteger'}
],
geometryType: '',
features: features
}
return FeatureSet(Text(out_dict))
It works but I want to se a value range instead then specific. Please help me improve this expression, tank you.
formelltNamn2023 histogram VAR27 AR FID
| "xxkommun, x" | "50-60" | 54 | 2019 | 0 |
| "xxkommun, x" | "70-80" | 79 | 2020 | 1 |
| "xkommun, x" | "20-30" | 29 | 2021 | 2 |
| "xxkommun, x" | "1-10" | 9 | 2022 | 3 |
| "xxkommun, x" | "" | 12 | 2023 | 4 |
| "xxstad, x" | "" | 3 | 2019 | 5 |
| "xxstad, x" | "" | 7 | 2020 | 6 |
| "xxstad, x" | "" | 3 | 2021 | 7 |