A simple expression...

690
4
05-10-2011 07:29 AM
BrianCoward
New Contributor II
Alright, let me see if I can explain this clearly. 
There are 3 variables:

[APN] - String
[Shp_Acerage] - Double
[APN_ac] - Double

I need records with the same [APN] to add up the [Shp_Acreage] in the [APN_ac].  The outcome of this would be...

2 or more records with the same [APN]:

[APN]                      [Shp_Acreage]        [APN_ac]
046-260-003-000       29.48                    43.67
046-260-003-000       1.53                      43.67
046-260-003-000       10.91                    43.67
046-260-003-000       1.75                      43.67

I was planning on running this through the Calculator on the [APN_ac] field but if there is a better way... I'll take it.  Seems like a simple thing to do but I haven't had any luck.  Appreciate the help,
Brian
0 Kudos
4 Replies
michaelcollins1
Occasional Contributor III
off the top of my head:

create a table with APN & APN_AC

join it to your existing table based on APN
0 Kudos
BrianCoward
New Contributor II
mcollinsamec,
That makes sense to me. I would assume that the new table would only have unique APN values? Could you help me with how to populate the new APN table with unique values? I've got the code below but I'm not sure how to point the sField to the feature class and field. Thanks for the help,
Brian

Static d As Object
Static i As Long
Dim iDup As Integer
Dim sField

sField = CMA_3_50ft_PARCELS[APN]

If (i = 0) Then
Set d = CreateObject("Scripting.Dictionary")
End If
If (d.Exists(CStr(sField))) Then
iDup = CMA_3_50ft_PARCELS[APN]
Else
d.Add CStr(sField), 1
iDup = 0
End If
i = i + 1
0 Kudos
michaelcollins1
Occasional Contributor III
Sorry, but coding isn't my bag.

Yes, the new table would be a relates or look-up table with unique values for APN.
0 Kudos
BrianCoward
New Contributor II
Oh wow... this was far easier then I was making it.  All I had to do was Summarize on the [APN] field and check the Sum box in the acreage field.  The resulting table is exactly what I was looking for.  Mcollinsamec, thanks for the post.
0 Kudos