Skip to main content
Solved

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


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:

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

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+5
  • 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
courtney_m wrote:

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+5
  • Contributor
  • August 17, 2017
annabelleatsafe wrote:
@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!!


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