Select to view content in your preferred language

Applying field calculator only on selected features

13944
26
12-13-2017 08:40 AM
NavidMoghadam
Occasional Contributor

In #ArcGISPro 2.0.1 Field calculator applies the value on ALL features and not only SELECTION. The same operation worked perfectly with the same data in the same FGDB in ArcMap.

0 Kudos
26 Replies
DanPatterson_Retired
MVP Emeritus

That hasn't been my experience.  Do you have an image of running the calculate field when the table is open with records selected to demonstrate?  It is a file geodatabase table I presume? or is it some other form of table?

NavidMoghadam
Occasional Contributor

Hi Dan, 

I can't find the reason but I retried it and now it's working! It applies only to selected features. I posted it on ArcGIS Ideas anyways and will return to this post if it repeats again. 

Thanks for your answer

0 Kudos
WrightKennedy
Occasional Contributor

Recently, I had the same problem in AGP 2.1. Here's what I found:

Calculate Field ignored the selection parameters when calculating a field in a feature class that was included multiple times in the map. Once I removed the copies of the feature class, Calculate Field worked as expected (calculated only the selected features). Hope this helps, and hope ESRI documents/fixes this!

KoryKramer
Esri Community Moderator

Are we talking duplicate layer names or two differently named layers that reference the same gdb dataset?

0 Kudos
WrightKennedy
Occasional Contributor

It occurs when multiple copies of the same source feature class are in the map. Aliases don't seem to matter.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Interesting find.  I have never used multiple copies of the same featureclass in the same map before.  PRO is probably getting confused, or perhaps taking the first incarnation that it finds in the Table of Contents rather than the selected and delimited one.

0 Kudos
KoryKramer
Esri Community Moderator

This is a known issue when more than one layer has the same name in the Contents pane which is why the statement "aliases don't seem to matter" is critical.  I cannot reproduce this when the layer names are different.

Let me walk you through my testing:

In the screenshot below, I want to calculate the subtype for record 3.  I right-click the subtype field > Calculate Field

Then for some reason I decide that I want to calculate record 1 to equal Medium (subtype 2) in my other table, for the other layer, so in the tool, I switch to points:2, and calculate to = 2.

Nothing happens – well, nothing appears to happen but what actually happened was that record 3 in points:1 already equals 2 so it was calculated to the same value:

This seems to be because the tool is still referencing the selection from the first layer on the left.

 

Because even though I’m now referencing points:2 in the tool, and record 1 is selected, if I now set that to equal 1 (should change record 1 to Small in the right-hand attribute table) it calculates it for points:1

 

This is the scenario that we know about. I haven’t seen this happen when the layers are actually named differently.

Please either provide a reproducible case with step-by-step instructions and screenshots like above where you have different layer names, or open a case with technical support to fully investigate and report the issue.  Thank you!

WrightKennedy
Occasional Contributor

I haven't been able to reproduce the error or the issue you documented. I just updated to 2.1.3 in the past week, but I didn't see anything in the change log about this. Are you in 2.1.3?

0 Kudos
KoryKramer
Esri Community Moderator

I'm glad that you can't reproduce this.  I don't think the version is important here.  I could reproduce what I outlined above in 2.x (and probably in 1.x if we needed to prove it) because this is a known issue with layers in the Contents pane that have the same name.  We would need a reproducible case of this happening with layers that are named differently in the Contents pane, because that is not something we're aware of and is not something that we've been able to reproduce.  Please do follow up here if you can show us a way that that happens.  Thank you!

0 Kudos