Skip to main content

Is there a transformer to read the unique values contained within an attribute and then assign a new value? Similar to the way that the attribute manager works but for values. For example I have a dataset with the columns fruits:

 

Fruits New Value

-------- ----------------

Apple > Green Apple

Banana

Orange > Blond Orange

Kiwi > Golden Kiwi

 

Ideally the transformer would read the unique values listed in the Fruits attribute and then I could specify the new value for the output.

 

As I am working with large datasets, I do not want to have to create a mapping rule for every value individually. Ideally the values would be automatically clustered and would be presented in a table and I could then just specify the newly mapped value.

Hi @jpach​ ,

 

Take a look at the AttributeValueMapper. Note the import option if you already have a document that outlines the attribute value map - if not, you can still import the source values by importing from the same dataset as your reader.

image


I agree about the AttributeValueMapper, but if the mappings already exist in a database you could consider using the DatabaseJoiner. Just make sure to define a prefetch query to populate the cache, and set the cache size to hold all the contents of the lookup table at once. This will make the lookup very fast, and will let the workspace fetch the mapping rules from the database rather than having them hard-coded in the workspace.


Hi @jpach​ ,

 

Take a look at the AttributeValueMapper. Note the import option if you already have a document that outlines the attribute value map - if not, you can still import the source values by importing from the same dataset as your reader.

image

Thank you for your reply. I do not have a reader as I query the data through an API and I do some filtering before it reaches the mapper (see attached image). If I understand correctly, does this mean that I need to write the data to a file and then read it back through the Import Wizard, as shown in your image? Is there no way to populate the source column in the of the Attribute Mapper with values existing in one of the data fields that are incoming from the AttributeManager?

 

 


Thank you for your reply. I do not have a reader as I query the data through an API and I do some filtering before it reaches the mapper (see attached image). If I understand correctly, does this mean that I need to write the data to a file and then read it back through the Import Wizard, as shown in your image? Is there no way to populate the source column in the of the Attribute Mapper with values existing in one of the data fields that are incoming from the AttributeManager?

 

 

Hi @jpach​ ,

 

Unfortunately the AttributeValueMapper doesn't have the option to Import from Feature Cache (yet). But if you connect your AttributeManager to an Excel Writer and run it, you can then import the values from the excel file (time saver when authoring). After you import the values you can delete the Excel writer from the workspace as it'll no longer be needed.


Thank you for your reply. I do not have a reader as I query the data through an API and I do some filtering before it reaches the mapper (see attached image). If I understand correctly, does this mean that I need to write the data to a file and then read it back through the Import Wizard, as shown in your image? Is there no way to populate the source column in the of the Attribute Mapper with values existing in one of the data fields that are incoming from the AttributeManager?

 

 

Thank you for your reply. In this case, what is the best practice for mapping multiple columns? It seems that the attribute value mapper also stores all of the data in the "unmapped" columns. This doesn't seem very efficient if a separate value mapper is needed for every column. Is it possible to split the columns/features upstream of the mapper and then recombine them in the final result?


Thank you for your reply. I do not have a reader as I query the data through an API and I do some filtering before it reaches the mapper (see attached image). If I understand correctly, does this mean that I need to write the data to a file and then read it back through the Import Wizard, as shown in your image? Is there no way to populate the source column in the of the Attribute Mapper with values existing in one of the data fields that are incoming from the AttributeManager?

 

 

I'm not sure what the best practice for this would be but we do have a request for this on the ideas page. If you could share your business case on there and upvote that might help to motivate the idea!


Reply