Select to view content in your preferred language

Populate missing dates from features in the same feature class

195
2
Jump to solution
05-29-2025 05:53 AM
GregN_WesslerEng
New Contributor

I have a feature class of water Mains. About half of the mains are missing the install date, and spatially the lines with missing install dates are in between two lines with dates. Can I use attribute rules to find the install dates of connecting lines and populate the install date with the older date? Or would Field Calculator be better since this needs to only apply to features where InstallDate is NULL?

0 Kudos
1 Solution

Accepted Solutions
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

If you only need to update the null values once then a simple calculation using arcade will do the trick. It would look something like this.

var OID = $feature.OBJECTID
var DV = $feature.<DateField>
if( IsEmpty( DV ) ){ DV = Today() }

var FS = Filter( $featureset, 'OBJECTID <> @OID' )
var I = Intersection($feature, FS)
if( Count(I) > 0 ){
	for( var row in I ){
		if( row.<DateField> < DV ){ DV = row.<DateField> }
		}
	}
return DV

View solution in original post

0 Kudos
2 Replies
JonM32
by
Frequent Contributor

@GregN_WesslerEng I would use field calculator to populate the date.

You can do a select by location to select the lines with no dates based on their relationship with dated lines and then populate the date field with the calculator with whatever date you chose.

Jon

Jon
0 Kudos
RPGIS
by MVP Regular Contributor
MVP Regular Contributor

If you only need to update the null values once then a simple calculation using arcade will do the trick. It would look something like this.

var OID = $feature.OBJECTID
var DV = $feature.<DateField>
if( IsEmpty( DV ) ){ DV = Today() }

var FS = Filter( $featureset, 'OBJECTID <> @OID' )
var I = Intersection($feature, FS)
if( Count(I) > 0 ){
	for( var row in I ){
		if( row.<DateField> < DV ){ DV = row.<DateField> }
		}
	}
return DV
0 Kudos