Question

Lookup values in a custom transformer ?

  • 19 January 2017
  • 4 replies
  • 2 views

Userlevel 1
Badge +22

Hi,

I need to convert multiple numeric codes in multiple tables into meaningful texts via a suitable "lookup table" (actually a view on SQL Server, but that's not important). Since I need to do this multiple (10+) times, I want to create a custom transformer with published parameters for input and output variables.

How do I do this ?

My attempts sofar has only resulted in an error: Undefined macro 'VAR_NAME' dereferenced in file ...

Cheers

Lars I


4 replies

Userlevel 2
Badge +17

If your lookup table is unlikely to change, you can the AttributeValueMapper transformer to do the lookup. The transformer allows you to import the lookup keys and values from SQL Server view.

If the lookup table is non-static, the Joiner transformer is better for doing the lookup.

Badge +22

What transformer are you using to retrieve the information? In the fme macro values table the custom transformer parameters are prefixed by the name of the custom transformer, and in certain cases that is not automatically resolved, leading to an undefined macro error.

Userlevel 1
Badge +22

If your lookup table is unlikely to change, you can the AttributeValueMapper transformer to do the lookup. The transformer allows you to import the lookup keys and values from SQL Server view.

If the lookup table is non-static, the Joiner transformer is better for doing the lookup.

Alas, they cannot be made fixed, although they probably rarely change. Due to the number of values alone, the values need to be read from a view in the database, hence the need to wrap it somehow.

 

 

Userlevel 1
Badge +22

Closing the question.

Reply