Is there a widget that displays a count of unique values in a given field?

3315
13
02-26-2017 02:21 PM
PaulHaakma
Regular Contributor

I have a field in a webmap called 'deviceId' that displays a unique string for each device that pushes data into it.

Ideally, I want a widget in an Operations Dashboard that displays a count of the number of unique devices.

I can see how to display a count of features, but can't see how to create a query that filters by unique value.

In a round-a-bout way, a bar graph achieves something similar, by displaying a unique bar for each deviceId with counts of the number of features for that deviceId, but it's not the effect I want. I just need a single count figure.

Any ideas?

13 Replies
YorladyVela2
New Contributor III

You could start by using the Query widget to help identify any unique devices and then create a counter that takes the query results and displays them according to count per unique device in a summary widget . I hope it works for you.  

MattFlowerday
New Contributor II

Hi there

 

thanks for the reply.

 

Can you elaborate please on how you would create the query?

 

When specifying the query criteria, it allows you to choose a field, an operator and a value. The operators are contains, equal, not equal, is blank and is not blank. None of those seem to allow you to specify unique values and I can't see how you would use any of those to get a count of unique features.

YorladyVela2
New Contributor III

Hi 

My suggestion is the as follows:

First Create a query widget and insert a query by atribute.

 

Then create a resumen widget. In the source dataset shoose the results of the query widget.

When you execute a query, the resume widget shows the count given the query.

Suggestion
0 Kudos
PaulHaakma
Regular Contributor

Hi Yorlady

Thanks for replying.

I might not be explaining myself properly though. Take the following sample table data:

 objectid  |  deviceId

1             |   ABCDEFG

2             |   ABCDEFG

3             |   ABCDEFG

4             |   ZYXWVUT

You can see that there are four  records, but three have the same deviceid. I want the summary count to report the count as '2', because there are two unique deviceid's in the table.

I understand the 'summary' (resume in Spanish??   ) widget, but cannot see any way, using the standard query tools that are available, to create a query that returns unique values.

The equivalent SQL query would be something like: 'SELECT DISTINCT deviceId from.....' .

I don't think it can be done using the standard tools, but still hoping someone might suggest a way so we don't have to custom write something...!   

deleted-user--W0njQoLz5cX
New Contributor II

Hi Paul,

Just to check did you find the solution to the above ? I am also stuck on the same issues, and any help from you will be appreciated.

Thanks,

Amit Prakash

PaulHaakma
Regular Contributor

No, not out of the box.

0 Kudos
deleted-user--W0njQoLz5cX
New Contributor II

Hi Paul,

Any idea , how can we achieve this by custom ?

Thanks and Regards,

Amit Prakash

0 Kudos
PaulHaakma
Regular Contributor

No. I passed it on to a dev team to look into, I don't think they even used Ops Dashboard.

deleted-user--W0njQoLz5cX
New Contributor II

Ok , thanks for the information.

Thanks and Regards,

Amit Prakash

Bristow Group Inc.

2103 City West Blvd., 2nd Floor

Houston, TX 77042

Office: +1-713-267-7659

Mobile: +1-346-228-4258

0 Kudos