Solved

Passing an equation into FME to calculate

  • 24 September 2020
  • 6 replies
  • 40 views

I've created an excel sheet with a series of dataset names and different equations to run against them e.g. @Value(COV_LEVEL)-@Value(INV_LEVEL)

 

Using fme_feature_type and FeatureMerger I am able to get my datasets and the required equations together. How do I tell FME that to use the content of my Feature Attribute as an equation and action it rather than as seeing it as a text string?

 

thanks

icon

Best answer by ebygomm 28 September 2020, 11:45

View original

6 replies

Badge +2

@har40428​  You just missed the Excel webinar this morning where we demonstrated this - see https://www.safe.com/webinars/ (it'll be posed in a day or so).

You have to formulate the formulate in the Excel syntax, not in an FME formula syntax. Something like:

SUM(C@Value(_row):N@Value(_row))

I've attached an example workspace form the webinar.

@har40428​  You just missed the Excel webinar this morning where we demonstrated this - see https://www.safe.com/webinars/ (it'll be posed in a day or so).

You have to formulate the formulate in the Excel syntax, not in an FME formula syntax. Something like:

SUM(C@Value(_row):N@Value(_row))

I've attached an example workspace form the webinar.

 

​Thanks Mark. Ironiclly I phoned a colleague to get some help on this and he wasa mid way through the webinar. Perhaps my interuption prevented him from seeing just the right bit

 

I've been through the example you sent and i'm not sure its exactly what i'm looking for. I am creating a data quality workbench which has an excel workbook to provide 'configuration' . For example it lists all the datasets being run and all their columns. Against each the word yes or no is selected from a dropdown. FME reads the dataset plus the workbook, joins the two and runs its assessment where the user selected yes in the excel sheet. It allows non FME users to configure the run in an application they are familar. I have similar tabs specifiying the length of attributes, whether special characters are allowed, and ahost of other data quality assessments.   

 

One particualr assessment I want to run in FME is to test whether a column matches the result of an equation e.g. DP_TO_INV should match @value(COV_LEVEL)-@value(INV_LEVEL). I have written this in excel and am passing into FME. What I can't figure out is how in enact @value(COV_LEVEL)-@value(INV_LEVEL) in FME - it just sees it as a text value 

Userlevel 1
Badge +21

 

​Thanks Mark. Ironiclly I phoned a colleague to get some help on this and he wasa mid way through the webinar. Perhaps my interuption prevented him from seeing just the right bit

 

I've been through the example you sent and i'm not sure its exactly what i'm looking for. I am creating a data quality workbench which has an excel workbook to provide 'configuration' . For example it lists all the datasets being run and all their columns. Against each the word yes or no is selected from a dropdown. FME reads the dataset plus the workbook, joins the two and runs its assessment where the user selected yes in the excel sheet. It allows non FME users to configure the run in an application they are familar. I have similar tabs specifiying the length of attributes, whether special characters are allowed, and ahost of other data quality assessments.   

 

One particualr assessment I want to run in FME is to test whether a column matches the result of an equation e.g. DP_TO_INV should match @value(COV_LEVEL)-@value(INV_LEVEL). I have written this in excel and am passing into FME. What I can't figure out is how in enact @value(COV_LEVEL)-@value(INV_LEVEL) in FME - it just sees it as a text value 

The V in @Value needs to be a capital letter and you need to make sure you use the arithmetic editor

Capture

 

​Thanks Mark. Ironiclly I phoned a colleague to get some help on this and he wasa mid way through the webinar. Perhaps my interuption prevented him from seeing just the right bit

 

I've been through the example you sent and i'm not sure its exactly what i'm looking for. I am creating a data quality workbench which has an excel workbook to provide 'configuration' . For example it lists all the datasets being run and all their columns. Against each the word yes or no is selected from a dropdown. FME reads the dataset plus the workbook, joins the two and runs its assessment where the user selected yes in the excel sheet. It allows non FME users to configure the run in an application they are familar. I have similar tabs specifiying the length of attributes, whether special characters are allowed, and ahost of other data quality assessments.   

 

One particualr assessment I want to run in FME is to test whether a column matches the result of an equation e.g. DP_TO_INV should match @value(COV_LEVEL)-@value(INV_LEVEL). I have written this in excel and am passing into FME. What I can't figure out is how in enact @value(COV_LEVEL)-@value(INV_LEVEL) in FME - it just sees it as a text value 

​Thanks ebygomm - just what I needed

Hi, I have another problem. I want to concatenate two attributes and I want to pass this as a string (attribute value) from the configuration file - @Value(MUNICIPALITY) @Value( MUN). Is it possible? @Evaluate is not working in this case.

Userlevel 1
Badge +21

Hi, I have another problem. I want to concatenate two attributes and I want to pass this as a string (attribute value) from the configuration file - @Value(MUNICIPALITY) @Value( MUN). Is it possible? @Evaluate is not working in this case.

@Evaluate is just for arithmetic expressions, if you are just concatenating a string you just need the text editor.

Reply