Get the "Start Count" for the Counter from a different dataset
Article Number: 000001217 - Last Modified: Sep 20, 2011
You are reading a dataset and want to assign unique id's to the features in this dataset using a Counter transformer. However, the starting value for the Counter is stored in a different dataset (in this example we'll pretend it's coming from a table in a database). How do you use that start value without passing the feature from the database table to the Counter? You don't want to pass this database feature to the Counter because it will use up the first count value.
The key is the VariableSetter and VariableRetriever transformers. One way to achieve this:
- Set up your first source dataset. The first dataset in the Navigator pane is the database dataset which reads from the table holding the start count value.
- Attach a VariableSetter to the source feature type from the database, setting the value of the variable to the attribute holding the start count.
- Set up your second dataset. This dataset contains the features that need to be tagged with unique id's using the Counter.
- Attach a VariableRetriever to the source feature type from the second dataset. This will receive the variable from the VariableSetter. The "Attribute Receiving Value" now holds the Start Count.
- Attach a Counter to the VariableRetriever.
Note that for this to work the database must be the first dataset read by the workspace (be listed at the top of the Navigator pane). This ensures the variable is set by the VariableSetter before it is read by the VariableRetriever.
|
Suggested Similar Articles