Skip to main content
Question

Sum attributes for each record

  • November 4, 2020
  • 3 replies
  • 259 views

markcoopersdc
Contributor
Forum|alt.badge.img+6

Hi

 

I have a database which has about 80 attributes that I need to add together. Short of manually creating an attribute in Attribute Manager's arithmetic editor, is there another way that can sum there? I thought about creating a list, but that creates a numbered element per feature, not per field like I need.

 

Many thanks

Mark

3 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • November 4, 2020

Assuming this is what you are after, so adding up multiple attributes from the same feature

Capture 

Inefficient way

  • Use AttributeExploder to explode the attribute into features per attribute
  • Get rid of any features that contain an AttributeName you don't want to sum (e.g. format attributes)
  • Aggregate based on some original record id and sum AttributeValues

 

Efficient way

  • Use python

 

Another way

  • If all the attributes you want to sum share a common prefix, you can use a ListPopulator to build a list followed by a ListSummer. You can use a bulk attribute renamer to add the prefix if it doesn't already exist and remove again later

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • November 4, 2020
ebygomm wrote:

Assuming this is what you are after, so adding up multiple attributes from the same feature

Capture 

Inefficient way

  • Use AttributeExploder to explode the attribute into features per attribute
  • Get rid of any features that contain an AttributeName you don't want to sum (e.g. format attributes)
  • Aggregate based on some original record id and sum AttributeValues

 

Efficient way

  • Use python

 

Another way

  • If all the attributes you want to sum share a common prefix, you can use a ListPopulator to build a list followed by a ListSummer. You can use a bulk attribute renamer to add the prefix if it doesn't already exist and remove again later

Actually the ListPopulator doesn't appear to work correctly with a BulkAttributeRenamer in front of it...


bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist
  • November 5, 2020
ebygomm wrote:

Actually the ListPopulator doesn't appear to work correctly with a BulkAttributeRenamer in front of it...

What about with ListExpressionPopulator instead? I'm sure I've done the same technique like this in a workspace with BulkAttributeRenamer + ListExpressionPopulator?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings