Skip to main content
Solved

What's the best way to handle calculations for filtered attributes?

  • August 17, 2017
  • 5 replies
  • 27 views

Forum|alt.badge.img

I have a Culvert table with 90K rows. Each culvert belongs to one of 7 size categories. Each category uses a different formula to calculate a culvert's replacement cost. I'm currently using TestFilter to define the size categories. I then route each output to its own ExpressionEvaluator. Is there a way to use a single transformer with a CASE statement to accomplish the same thing?

Best answer by courtney_m

You can do this with an AttributeManager (or AttributeCreator for older versions of FME). Type in the name of the new attribute you want to create - then click on the drop-down arrow on that line, and select Conditional Value:

In the conditional value dialog, you can set up your conditional statements like you did in your TestFilter. But you can specify an output value for each statement. See the screenshot below on how to use the Arithmetic Editor to calculate the value for each statement:

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.

5 replies

Forum|alt.badge.img+6

Hi @randall_robie,

One thought I had is that the AttributeManager contains the tools to create Regular Expressions/perform calculations. Perhaps one way to go about this, is to route your TestFilter results (each of which will have its own attribute value) to the AttributeManager (could use a Junction to tidy up the multiple streams beforehand), where you can perform the calculations for each attribute in this 1 transformer. Would this be an option?


courtney_m
Contributor
Forum|alt.badge.img+20
  • Contributor
  • Best Answer
  • August 17, 2017

You can do this with an AttributeManager (or AttributeCreator for older versions of FME). Type in the name of the new attribute you want to create - then click on the drop-down arrow on that line, and select Conditional Value:

In the conditional value dialog, you can set up your conditional statements like you did in your TestFilter. But you can specify an output value for each statement. See the screenshot below on how to use the Arithmetic Editor to calculate the value for each statement:


Forum|alt.badge.img+6

You can do this with an AttributeManager (or AttributeCreator for older versions of FME). Type in the name of the new attribute you want to create - then click on the drop-down arrow on that line, and select Conditional Value:

In the conditional value dialog, you can set up your conditional statements like you did in your TestFilter. But you can specify an output value for each statement. See the screenshot below on how to use the Arithmetic Editor to calculate the value for each statement:

@courtney_m this is a great post!

 


courtney_m
Contributor
Forum|alt.badge.img+20
  • Contributor
  • August 17, 2017
@courtney_m this is a great post!

 

Thank you. I didn't see your post before I posted mine. :-(

Forum|alt.badge.img

Annabelle and Courtney ... thank you both for the feedback. I think the AttributeManager solution is what I'm looking for. Best regards to you both!!