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?
Solved! Go to Solution.
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
@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
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