Skip to main content
Solved

Calculate the field value based on another field.

  • February 17, 2019
  • 8 replies
  • 97 views

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.

View original
Did this help you find an answer to your question?

8 replies

takashi
Supporter
  • 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?


  • Author
  • February 17, 2019
takashi wrote:

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
Supporter
  • Best Answer
  • February 17, 2019

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

e.g.


  • Author
  • February 17, 2019
takashi wrote:

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
Supporter
  • February 17, 2019
takashi wrote:

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

e.g.

Have a look at the StringFormatter.


  • Author
  • February 19, 2019
takashi wrote:

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
Supporter
  • February 19, 2019
takashi wrote:

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.


  • Author
  • February 19, 2019
takashi wrote:

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.


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