Question

How can I avoid using a Counter?


I am using a statistics calculator for a max value and then use the counter to proces new features which receives the new value thats Counter start = @value()+1. However it keeps failing due to an INVALID_PARAMETER_COUNT_START. I can't figure out why it fails. I tried setting the scope to global or local but it just doesn't want to work.

So does anyone have an idea on how to avoid the Counter and get the same result?

My thanks in advance!

- Zoë


9 replies

Userlevel 3
Badge +26

In the counter, you will need to specify the max attribute created in the StatisticsCalculator. @value()+1 is simply returning a null value. It will be something like @Value(max).

image

In the counter, you will need to specify the max attribute created in the StatisticsCalculator. @value()+1 is simply returning a null value. It will be something like @Value(max).

image

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

Userlevel 3
Badge +26

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

@zoedongen​ Have you inspected the output from the StatisticsCalculator to make sure you are getting a numerical result? If you attach the log file, that would be helpful to figure out what's going on as well.

 

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

Log file says this = Nieuw_BOOMID: Failed to evaluate expression '@real64(<null>+1)'. Result is set to null. So it makes sense now that it says invalid start count because it's literally null. How can I make sure that the result is numerical? I thought setting the calculation mode to numerical was enough?

image

Userlevel 3
Badge +26

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

Can you provide the data, or a screenshot of the boomid attribute in Data Inspector?

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

imageNot sure why but FME reads all my Oracle spatial Object attributes as strings. That must be the problem cause it can't calculate with a string value. But how can I make sure my reader doesn't turn al my attributes into string values?

Userlevel 3
Badge +26

Hi, Thanks for your quick response!

I'm using @Value(BOOMID.max)+1 as Count start.

 

image

@zoedongen​ What is the value of BOOMID.max after the StatisticsCalculator?

Badge +2

@zoedongen​ NullAttributeMapper will clean up any <null> values for you

Badge +3

instead of a counter u can use a sampler (sample first to initiate counter attribute) and a attribute creator in adjacent mode to increment counter attribute.

 

Reply