Skip to main content
Solved

Calculate the field value based on another field.

  • February 17, 2019
  • 8 replies
  • 122 views

gisuser
Participant
Forum|alt.badge.img+4

Hi FME Experts,

 

I have a field, I would like to create a new field based on duplication of the records in this field . as the attached image, is there any way to do that?

 

 

Thanks in advance

Best answer by takashi

OK. You can use the Counter with a counter name containing the user name.

e.g.

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.

8 replies

takashi
Celebrity
  • 7843 replies
  • February 17, 2019

Do you need to get the number of records for each User Name? That is, should you get 3 for A, 1 for B, 6 for D in your example?


gisuser
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • 19 replies
  • February 17, 2019

Do you need to get the number of records for each User Name? That is, should you get 3 for A, 1 for B, 6 for D in your example?

@takashi

No, I want the result to be like the (user_id) field in the screenshot


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • February 17, 2019

OK. You can use the Counter with a counter name containing the user name.

e.g.


gisuser
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • 19 replies
  • February 17, 2019

OK. You can use the Counter with a counter name containing the user name.

e.g.

@takashi

Thank you, what about if I want to the output to be (00001,00002,.....,00026), in which the number of digits to be 5.


takashi
Celebrity
  • 7843 replies
  • February 17, 2019

OK. You can use the Counter with a counter name containing the user name.

e.g.

Have a look at the StringFormatter.


gisuser
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • 19 replies
  • February 19, 2019

Have a look at the StringFormatter.

Thank you @takashi ,

 

Could you please assist me it this?

I am trying to extract the Max value from a field then use it in calculating the value for another field (sequence).

 

But it gives me the below error


takashi
Celebrity
  • 7843 replies
  • February 19, 2019

Have a look at the StringFormatter.

If you intend to newly create the attribute "PID" in the AttributeManager with such parameters setting, try exposing "PID" with the AttributeExposer beforehand.

However, I think you can do it with the Counter (Count Start: 150266) more easily.


gisuser
Participant
Forum|alt.badge.img+4
  • Author
  • Participant
  • 19 replies
  • February 19, 2019

If you intend to newly create the attribute "PID" in the AttributeManager with such parameters setting, try exposing "PID" with the AttributeExposer beforehand.

However, I think you can do it with the Counter (Count Start: 150266) more easily.

The counter was the alternative solution but should be a more effective way, which the user no need to but the max value from his end.

 

should be a way to extract the max value (statisticscalculation) , then take a max value then use it to calculate the new field.