Skip to main content
Solved

Concatenate values in groups of 5


jeroen_hack
Contributor
Forum|alt.badge.img+7

Hi fellow FME enthousiasts,

Another case i'm struggling with today.

I have a list of parcels that need to be added into a Excel template. In most cases I can sort the parcels by parcelnumber and concatenate them grouped by the Section number and write them to the Excel.

But the field in the template can fit a maximum of 5 parcel numbers. So if there are more then 5 parcels they need to be split in groups of 5. 

So say i have a file with 13 parcels, I would need to split them into 3 groups (2 of 5 parcels and 1 of 3 parcels). 

I can get the number of parcels with a StatisticsCalculator, but i struggle with the part where i have to split them into groups to write to the Excel. How would you do this?

 

Cheers!

Best answer by becchr

many ways to achieve this I think, but for example:

  • use a counter to calculate a number but do it per section (Count Domain → Section, let’s call the resulting attribute SectionCounter)
  • create a new attribute ‘ParcelGroup’ and calculate it as:
@Evaluate(@floor(@Value(SectionNumber)/5,0))

this ParcelGroup will be 0, 1, 2, … per 5 occurences in a Section

View original
Did this help you find an answer to your question?

2 replies

becchr
Influencer
Forum|alt.badge.img+25
  • Influencer
  • Best Answer
  • March 29, 2024

many ways to achieve this I think, but for example:

  • use a counter to calculate a number but do it per section (Count Domain → Section, let’s call the resulting attribute SectionCounter)
  • create a new attribute ‘ParcelGroup’ and calculate it as:
@Evaluate(@floor(@Value(SectionNumber)/5,0))

this ParcelGroup will be 0, 1, 2, … per 5 occurences in a Section


jeroen_hack
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 29, 2024
becchr wrote:

many ways to achieve this I think, but for example:

  • use a counter to calculate a number but do it per section (Count Domain → Section, let’s call the resulting attribute SectionCounter)
  • create a new attribute ‘ParcelGroup’ and calculate it as:
@Evaluate(@floor(@Value(SectionNumber)/5,0))

this ParcelGroup will be 0, 1, 2, … per 5 occurences in a Section

Thank you, this is what i was looking for!

 

Cheers and happy easter!


Reply


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