Select to view content in your preferred language

List possible combinations - Arcade

291
4
Jump to solution
09-01-2024 04:17 PM
Labels (1)
explocarto
Regular Contributor

Hello,

I have a table with this structure.

explocarto_0-1725232114727.png

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.

explocarto_1-1725232434650.png

Can someone help me ?

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

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' },
  ]
)
- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
4 Replies
explocarto
Regular Contributor

Hello @jcarlson,

Can you help me again ?

kind regards

0 Kudos
jcarlson
MVP Esteemed Contributor

Are the "phenomena" the name field? Or is that some other field not pictured?

- Josh Carlson
Kendall County GIS
0 Kudos
explocarto
Regular Contributor

Yes the phenomena correspond to the name field.

kind regards

0 Kudos
jcarlson
MVP Esteemed Contributor

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' },
  ]
)
- Josh Carlson
Kendall County GIS
0 Kudos