Hello, I have this list (see image): the Business RulesID & their count. I would like to add to this list all Business Rules IDs that are within the range of 1 to 25 & whose count is 0 (that's why their are missing),e.g. BusinessRuleId =4 & count=0
Question
Hello, I have this list (see image): the Business RulesID & their count. I would like to add to this list all Business Rules IDs that are within the range of 1 to 25 & whose count is 0 (that's why their are missing),e.g. BusinessRuleId =4 & count=0
One option (there are a few) would be to start with a Creator and sent the Number to Create to 25. This will give you 25 features with an attribute '_creation_instance' from 0-24. Then pass it to an attributemanager and configure it so you rename '_creation_instance' to 'BusinessRuleID' (optional) and add one to the value and add a new attribute called 'Count'
Then connect this to an featuremerger through the supplier port and connect your existing data to the requester port. Set the join on to BusinessRuleID (or _creation_instance for the supplier) for both. Make sure 'conflict resolution' is set to 'use requester'
One option (there are a few) would be to start with a Creator and sent the Number to Create to 25. This will give you 25 features with an attribute '_creation_instance' from 0-24. Then pass it to an attributemanager and configure it so you rename '_creation_instance' to 'BusinessRuleID' (optional) and add one to the value and add a new attribute called 'Count'
Then connect this to an featuremerger through the supplier port and connect your existing data to the requester port. Set the join on to BusinessRuleID (or _creation_instance for the supplier) for both. Make sure 'conflict resolution' is set to 'use requester'
There is no way to add the missing ones using a python caller for example?
It is definitely possible to do this using Python in the PythonCaller. For example, you can use this logic in the PythonCaller to create the output that you want.
However, it is generally recommended only use Python if there are no suitable transformers for the task. As @hkingsbury mentioned, there are a few workflows which can create the output wanted. For example, attached is a workspace which has two different methods to add the missing features.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.