Apply One Expression to Many Attributes | ExpressionEvaluator

Liz Sanderson
Liz Sanderson
  • Updated

FME Version

Introduction

The task here is to take an Excel table of voting data and apply an expression to 4 of the attributes to change them from a total value to a percent value based on the number of total voters.

http_download_1444329830729_6032.png
Excel Data Before Transformation

http_download_144432983186_6032.png
Excel Data After Transformation

In the ExpressionEvaluator, the @CurrentAttribute() function in FME 2015.0 or later is used to get the current value of the attributes chosen, apply the expression and replace them with the newly calculated value.

http_download_1444329831358_6032.png
ExpressionEvaluator Settings

 

Other examples of using CurrentAttribute would be to:

  • apply the same date/time format to several date/time attributes
  • apply a math function like round() to several attributes

CurrentAttribute is also available in the AttributeConcatenator

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.