Skip to main content
Question

How to count the number of features with the same value for an attribute


Hello,

 

 

I'm passing a load of lines through an FME workbench and eachline has a project name as an an attribute. I want to add an attribute that counts how many lines are in the project (share the project name). Does anyone know how to do this?

 

 

I've tried playing around with the counter but have had no luck. what I need is it to separate out into all the different projects, use the counter, then chuck everything back together. I would use a filter but there are hundreds of projects.

 

 

Any ideas?

 

 

Thanks

5 replies

takashi
Supporter
  • May 2, 2014
Hi,

 

 

I think the StatisticsCalculator can be used (Group By: project name).

 

 

Takashi

david_r
Evangelist
  • May 2, 2014
Hi,

 

 

you can set the "Counter name" to the name of your attribute. It will behave like a Group By and keep track of one sequence per unique attribute value..

 

 

David

takashi
Supporter
  • May 3, 2014
The Counter can create "Count1", the StatisticsCalculator can create "Count2".

 

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • May 6, 2014
Statisticcalulator can create count1 as well when you use cumulative output.

jan
Contributor
Forum|alt.badge.img+1
  • Contributor
  • August 12, 2020

This results in a Memory Error for me when having about 2.5 M feataures!


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