Skip to main content
Solved

Add until a certain value is reached

  • January 13, 2020
  • 2 replies
  • 51 views

Forum|alt.badge.img

Hi there!

 

I am working on a specific analysis. This analysis needs to calculate 13 000 ha of parcels (area) randomly and then assign a new attribute value to this.

Right now I have the following workflow:

I thought I could make this work by calculating the percentage and then use the Sampler to randomly select parcels, but this doesn't work because the sum of ha does not add up.

What I am looking for is a tool that allows me to use the following formula:

"Random amount of parcels added up" = 13 000 ha

So I guess it is a randomized sampler using a certain value based on attribute values.

 

Does anyone have any idea how to do this?

 

Thank you so much in advance!

Best answer by ebygomm

Could you add a random number to all your features, sort by the random number to create a random order, then use the cumulative output of a statistics calculator and test for any cumulative area below 13,000 ha. The ones that pass are your "random amount of parcels"

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

cdalessandro
Contributor
Forum|alt.badge.img+4
  • Contributor
  • January 13, 2020

I think it is enough use StatisticCalculator transformer using cumulative port. I wrote a simple example for You

are_added_up.fmw


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • January 13, 2020

Could you add a random number to all your features, sort by the random number to create a random order, then use the cumulative output of a statistics calculator and test for any cumulative area below 13,000 ha. The ones that pass are your "random amount of parcels"