0

There is the attribute table the FID_lote_teste fields and selecao both integer.

table

The selecao field receive zero (0) if the FID_lote_teste field number does not exist in memory.

For example:

First row: selecao gets 0 (zero) because the number 2 from FID_lote_teste field does not exist in memory;

Second row: selecao gets 0 (zero) because the number 3 from FID_lote_teste field does not exist in memory;

Third row: selection receive 1 (one) because the number 2 from FID_lote_teste field already exists in memory;

(...)

6th row: selecao gets 0 (zero) because the number 7 from FID_lote_teste field does not exist in memory;

7th row: selecao gets 0 (zero) because the number 8 from FID_lote_teste field does not exist in memory;

8th row: selecao receive 1 (one) because the number 7 from FID_lote_teste field already exists in memory;

(...)

How do I fill in the selecao field with the field calculator following this algorithm?

1

I answered this question before, sorry cannot find it. Use field calculator expression, python on field "selecao":

d={}
def GroupOrder(groupID):
  if groupID in d: d[groupID]+=1
  else: d[groupID]=0
  return d[groupID]

--------------------------

GroupOrder( !fid_loat_teste! )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.