Select to view content in your preferred language

AGOL Dashboard - Grouping values based on 2 data fields

931
3
10-30-2023 10:05 AM
Labels (2)
KenBouchard
Regular Contributor

Hi,

I'm working on a dashboard that will present our lab results for our samples. Basically, we have multiple samples taken at a location and then we received the results for each sample.

I need a TABLE that could summarize how many results came back as positive/negative for each location.

KenBouchard_1-1698685381808.png

 

I know it's possible to group by 1 category but is there a way to group by 2 categories?

KenBouchard_2-1698685410979.png

Thanks!

Ken

 

 

 

3 Replies
MobiusSnake
MVP Regular Contributor

I think using a Data Expression as your source (rather than a table directly) would let you do this.  You'd want to create a derived attribute that combines the two fields you're interested in.

jcarlson
MVP Esteemed Contributor

Piggybacking on this: Data Expression is the way to go, and with a nicely written GroupBy function, it wouldn't be that hard.

var fs = FeatureSetByPortalItem(
  Portal('arcgis.com'),
  'itemid of layer',
  0,
  ['location', 'results'],
  false
)

return GroupBy(
  fs,
  ['location', 'results'],
  {name: 'count', expression: '1', statistic: 'COUNT'}
)
- Josh Carlson
Kendall County GIS
KenBouchard
Regular Contributor

Oh...  arcade!  I'm just not sure how/where to use it.  Thanks, it points me to the right direction, I'll investigate this!  🙂

I've did little arcade coding before but not much.  However, I can appreciate this is a very powerful skill to possess.

Do you guys have any recommendations on resources to learn and develop my arcade skills?

(I already did the "Stay in the Game with ArcGIS Arcade" paid course from ESRI)

Thanks!

0 Kudos