Question

Counter error: doesn't give progressive numbers


I have to associate a simple progressive number (from 1 to the number of rows of my data). The Counter Transformer gives me back strange results: one time only even numbers, another only odd numbers and other times one every four (0,4,8,12,...).

I tried using the Arithmetic Editor in the AttributeManager but it produces the same error. How can I solve the problem?

Thank you!


9 replies

Badge +22

Is your count scope local or global?

Userlevel 4

If setting the count scope to "Local" on the Counter doesn't help, consider posting a screen shot of the Counter parameters here.

If setting the count scope to "Local" on the Counter doesn't help, consider posting a screen shot of the Counter parameters here.

Actually I tried both; however, I don't think this is a problem strictly referred to the Counter or its parameters because I get the same errors using the Arithmetic Editor.

Userlevel 2
Badge +19

Actually I tried both; however, I don't think this is a problem strictly referred to the Counter or its parameters because I get the same errors using the Arithmetic Editor.

Could you share the workspace or a screenshot of it? And a screenshot of your Counter parameters? Which version of FME are you using? It's a weird behaviour for the Counter, so I guess the problem could be in what you do before it.

 

Badge

Hello,

Just to let you know I have the same issue! I tried using an in-line counter too, (@sum(@double(@Count()),1.0)), and still got skipped values and the numbers would exponentially increase each time I ran the script. Please let me know if you solve it!

Thank you!

Userlevel 2
Badge +17

Hi @silviati, to clarify the situation, please answer these questions.

  • How many Counters are there in the workspace?
  • What name have you set to the Counter Name parameter for each Counter?
  • Which one have you set to the Count Scope parameter - Global or Local?

Hi @silviati, to clarify the situation, please answer these questions.

  • How many Counters are there in the workspace?
  • What name have you set to the Counter Name parameter for each Counter?
  • Which one have you set to the Count Scope parameter - Global or Local?

I had a very large workspace to run; given that I got this error, I made another workspace where only counters are running (only two).

I tried to use both Global and Local and now it is set al local. The name of the field where the counter should save the numbers are: ID and ID_SCHEDA, that shoould be my two new IDs of my table.

Given that I am working with Oracle tables, I am thinking of getting around this using an Oracle sequence.

 

Userlevel 5
Badge +25

I had a very large workspace to run; given that I got this error, I made another workspace where only counters are running (only two).

I tried to use both Global and Local and now it is set al local. The name of the field where the counter should save the numbers are: ID and ID_SCHEDA, that shoould be my two new IDs of my table.

Given that I am working with Oracle tables, I am thinking of getting around this using an Oracle sequence.

 

It would really help us if you could share that second workspace, the one that you mention.

I think I have it reproduced though:

Note that both Counters have the same Counter Name value and are set to Global. Changing both to Local solves it in my case and while it doesn't seem to have an effect it probably wouldn't hurt to set them to different counter names too.

Userlevel 2
Badge +17

Hi @silviati, to clarify the situation, please answer these questions.

  • How many Counters are there in the workspace?
  • What name have you set to the Counter Name parameter for each Counter?
  • Which one have you set to the Count Scope parameter - Global or Local?

@silviati, we all guess that you have set an identical Counter Name (not Count Output Attribute - ID, ID_SHEDA) to the multiple Counters and also left Global their Counter Scope.

Why not share the workspace containing two Counters, which reproduces the problem?

Reply