Select to view content in your preferred language

Operations Dashboard widget to display count of distinct unique values

6822
10
05-06-2018 07:16 PM
Status: Implemented
by Anonymous User
Not applicable

The idea is to create a new widget or make an enhancement to an existing widget to display a count of the distinct/unique values in a field.

The basic indicator widget allows you to display a total count of records, or statistics such as minimum, maximum, average etc. But currently not the ability to display the count of unique values.

e.g. given the following values in a hypothetical field 'FirstName':

Paul

Paul

Paul

John

Fred

John

The count of unique values would be 3, for 'Paul', 'John' and 'Fred'. 

Ironically, when you try to set a filter on the basic 'Indicator' widget where the value is equal to something, the widget provides a drop down list of all available distinct values - so it is likely already performing the necessary query! All we need if for it to do this and return the count of those as the actual result of the widget.

10 Comments
JackCibor

The same functionality would be helpful in WAB

TI
by

Ditto... I need this in Web App Builder (we use WAB instead of ops dashboard).

OSACAfrica

David NyenhuisDavid Nyenhuis‌ Any update on this?

DavidNyenhuis1

Hi OSAC Africa,

The count distinct option is currently available in ArcGIS Dashboards Beta. 

Vivek Malleshappawrote a good blog on this.

OSACAfrica

Apologies for lack of original clarity: for distinct count for lists in Beta.

souzadias

@DavidNyenhuis1 this is true only for some widgets like Indicator. I would like to be able to count distinct values in a pie chart. This is not possible even in beta. 

 

DavidNyenhuis1

Hi @souzadias

In the upcoming release of ArcGIS Online (next week), count distinct will become available in the pie chart and serial chart elements of dashboards. 

souzadias

@DavidNyenhuis1 

Awesome!! Thanks for the update 🙂

patrickb
Status changed to: Implemented

Count Distinct has now been released and is available for the elements in the previously mentioned blog post. For elements not mentioned, Arcade functions like GroupBy(), Count(), and Distinct() can now be used in the context of another exciting new feature: Data expressions 

JessicaFraver1

I now see the Distinct option, however, it is not working as I had hoped. I have a CIP Project Location feature layer which is referenced. Projects can have multiple locations, so I not only want to display a location count (N = 330), I also want to display a project count (N= 105) . I added a Survey123 dataset and got it to work. Does Distinct only work on hosted feature layers? That would be disappointing. Or do I need to create a newer version of the referenced layer to get it to work with this newer functionality?

I tried saving the Classic map in the new Map Viewer platform and then creating a dashboard from the new map, but that did not work either. I also tried creating a new map from scratch and added other hosted and referenced layers. It works on some fields, not all, with hosted - some give the incorrect overall total count instead of distinct count of values. Referenced gives a No Data result.

I have not yet checked out data expressions. Thanks for the suggestion @patrickb.