Skip to main content
Solved

Concatenate values in groups of 5

  • March 29, 2024
  • 2 replies
  • 64 views

jeroen_hack
Contributor
Forum|alt.badge.img+10

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

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.

2 replies

becchr
Influencer
Forum|alt.badge.img+32
  • 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+10
  • Author
  • Contributor
  • 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

Thank you, this is what i was looking for!

 

Cheers and happy easter!