Skip to main content

Hi, I would like to assign a unique count as a new attribute, based on the value of an existing attribute. I cannot find a solution: Counter, UniqueValueLogger and StatisticsCaltulator seem not be suitable for this. It is a large database. How do I manage this? I am not interested in the number of Pete's, Daisy's.

Example:

Old attributeDesired attributePete1Pete1Jacob2Daisy3Daisy3Daisy3

 

 

Sieger

I would use the DuplicateFilter followed by a Counter.

Then a FeatureMerger to merge the desired attribute on the original rows merging on the old attribute.

If the data is in a database (Oracle in my example), you could use two SQLCreators:

1) Complete table

2) Select old attribute, rownum from table.

Then a FeatureMerger to merge the rownum as desired attribute on the complete table.


Hi,

You can use an AttributeCreate and enable adjacent feature attributes (see my workspace)example.fmw


Hi,

You can use an AttributeCreate and enable adjacent feature attributes (see my workspace)example.fmw

Excellent. Also you can use the Default Value option, so that the conditional value setting could be simpler a little.

 

 

 


To throw out another idea, use an Aggregator-Counter-Deaggregator combination.


You can use a Matcher based on the Old Attribute and use the generated Match ID Output Attribute.

Note that you will have to deal with the features coming out of the NotMatched port and assign them a value by yourself.


There is more than one way. Assuming the records are sorted by the Old attribute, this workflow is also possible.


Thank you all! Glad that it works now...


Reply