Skip to main content
Question

Sum attributes for each record

  • November 4, 2020
  • 3 replies
  • 311 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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • 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+46
  • 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

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

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?