queries?

3422
7
Jump to solution
07-20-2015 10:24 AM
AlisonBates
New Contributor

Hi,

I am trying to build a query that tells me the number of unique vessels that entered a specific polygon. Each vessel may have gone to several polygons and visit each or any polygon multiple times. I am limited by confidentiality to only display the polygons that have 3 or more unique vessels that went there. I have tried a multitude of tools, but I think what I need is to build a query. Any idea how to build this? I have intersected the points (each record of a vessel) with the polygons, the intersection output is in a point shape file. Thank you!

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

Oh right. You can run Summary Statistics using both polygon ID and ship ID as case fields. This will give you one row per polygon/ship combination. Calculate a new field to hold the polygon/ship combination. Then, run Summary Statistics on that table, using the polygon/ship combination field as the case field, and anything as the statistic field. It will create a new frequency field counting each unique combination.

View solution in original post

7 Replies
DarrenWiens2
MVP Honored Contributor

Run Summary Statistics, using polygon ID as case field, and ship ID as the COUNT statistic field. Join the result back to your polygon layer to see the ship count for each polygon.

0 Kudos
AlisonBates
New Contributor

I did try that, but what it gives me is the total count of vessel activity in the cell, but not separated by unique vessels. For example, polygon "A" has 5 point records associated, and the statistics output was 5. however, when i look at my attribute table, only two vessels are associated: one vessel went twice, and the other went three times. So I cannot show this data. I need it to show the number of unique vessel IDs per polygon.

0 Kudos
DarrenWiens2
MVP Honored Contributor

Oh right. You can run Summary Statistics using both polygon ID and ship ID as case fields. This will give you one row per polygon/ship combination. Calculate a new field to hold the polygon/ship combination. Then, run Summary Statistics on that table, using the polygon/ship combination field as the case field, and anything as the statistic field. It will create a new frequency field counting each unique combination.

AlisonBates
New Contributor

Ah, that worked! THANK YOU!! I have been trying different tools for days. Using the two steps, I get exactly what I needed.

0 Kudos
VinceAngelo
Esri Esteemed Contributor

If you use the case field and statistic field, as Darren recommended, you shouldn't get the results you reported.

- V

0 Kudos
AlisonBates
New Contributor

Hi,

Once I used both in the case field, it worked. Using only one case field, it didn't give me a unique line for each vessel and poly. Thanks for your help!

0 Kudos
VinceAngelo
Esri Esteemed Contributor

Sorry for steering you wrong.

- V

0 Kudos