Hello,
I have a table with this structure.
As output i need a FeatureSet wich lists by zone all the possible combinations between "season_begin" and "season_end". Count the number of phenomena between these combinations and the average.
Can someone help me ?
Solved! Go to Solution.
Honestly unsure how to get an average from a string field, but this will give you the count of phenomena per unique zone/begin/end combination.
var fs = FeatureSetByPortalItem(
Portal('your portal url'),
'itemid of your service',
0, // layer index
['fields', 'you', 'need'],
false
)
return GrouBy(
fs,
[ 'zone', 'season_begin', 'season_end' ],
[
{ name: 'the_count', expression: 'phenomena', statistic: 'count' },
]
)
Are the "phenomena" the name field? Or is that some other field not pictured?
Yes the phenomena correspond to the name field.
kind regards
Honestly unsure how to get an average from a string field, but this will give you the count of phenomena per unique zone/begin/end combination.
var fs = FeatureSetByPortalItem(
Portal('your portal url'),
'itemid of your service',
0, // layer index
['fields', 'you', 'need'],
false
)
return GrouBy(
fs,
[ 'zone', 'season_begin', 'season_end' ],
[
{ name: 'the_count', expression: 'phenomena', statistic: 'count' },
]
)