Skip to main content
Question

Loop Counter


Forum|alt.badge.img
Hello everyone:

 

          Now I have an excel,the  item in it has fild " ID  ?GID... "?the“ ID” sometimes has same value.if the “ID” is unique ?set “GID = 1”?And if there are two items have same “ID“?set the first item's "GID = 1",set the second‘s “GID = 2“? I use the DuplicateRemover one after another can sove it?But I want use a Loop then there's somthing wrong . the Loop features can't be check by the DuplicateRemover ,they all transom output from the duplicate cort? 

 

         Any one can tell me something about this

4 replies

david_r
Evangelist
  • April 2, 2013
Hi,

 

 

if I understand you correctly, you have features like this, where you have a unique key on the combination of ID and GID:

 

 

ID  GID 1   1 2   1 2   2 2   3 3   1 4   1

 

Am I correct?

 

 

Not sure I understand your question, but is it possible that you could join (concatenate) the two values and use this combined value for the rest of your processing? Example: use a StringConcatenator with the value "@Value(ID)-@Value(GID)" would give you a new attribute with the following values:

 

 

"1-1"

 

"2-1"

 

"2-2"

 

"2-3"

 

"3-1"

 

"4-1", etc.

 

 

You could then probably drop the DuplicateRemover, and the following processing might be simplified by using this new attribute rather than the combination of ID and GID together.

 

 

Does this help at all?

 

 

David

 

 

Forum|alt.badge.img
  • Author
  • April 2, 2013
Hi ?David?

 

     Thanks for your reply? I only  have ID value? the GID value will set according to the ID value?

 

     The problem can solve by the  DuplicateRemover ?but there will lots of DuplicateRemover and attributecreator?So I use the loop  and the problem is coming the loop features can‘t separate by the DuplicateRemover?They all output from the duplicate port?

 

      I think you can make an excel to test it

david_r
Evangelist
  • April 2, 2013
Hi,

 

 

ok, let's see if I understand it this time. You have:

 

 

ID

 

1

 

2

 

2

 

2

 

3

 

4

 

 

and what a new attribute GID that restarts at 1 for each value of ID. Am I right?

 

 

If so, use a Counter with "Counter name" of ID and "Count start" of 1.

 

 

This will create one counter for each value of ID. Let us know if this is what you wanted.

 

 

If not, please give us a specific and concrete example of what you have and what you want.

 

 

David

Forum|alt.badge.img
  • Author
  • April 2, 2013
 Hi,David:

 

     Thank you very much,it's the best way to solve this problem use your method?

 

     

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