Hi Community,
I'm using an Iterative Macro to calculate how many years it will take for data to reach a target under a specific annual growth rate. The macro runs without any errors during testing. However, when I use this macro, I encounter the following error: Iteration #2: Tool #8: Parse Error at char(11): Unknown variable "Target"
Could someone help me troubleshoot this issue? Thank you!
Solved! Go to Solution.
You have this off. Your target input is labeled as your iterative input. Your data input needs to be your iterative input. In your outer macro. your target maps to your target. your data maps to your data. your growh maps to your growht. you also can use MATH to solve this.
Try log10([target]/[Data])/log10(1+[growth])
or wrap it in a ceil funtion if you want to round it.
You have mislabeled your Macro Inputs. The [Target] input is labeled "Iteration Input", but what you are iterating on is the [Data] field. If you rename (or at least change the Interface Designer settings. The error is resolved.
On another note, you currently have the [Data] field as an int type, which means your approximation for the final value (i.e. when Target is reached) will not be accurate.
Finally, I created a mathematical solution that just uses one equation in the formula tool should you be interested in that instead.
Hope this helps and Happy Solving!
Inside the macro, tool id 2, your first Macro Input, includes one field named Target. The field names, data types, and sizes in this Input must match your Iterative Macro Output, which is tool id 13 Macro Output.
But tool id 13 Macro Output has one field named Data. If you re-name the field Data to Target, you should be OK.
Chris
@ChrisTX @CoG @apathetichell Thank you all, it worked perfectly!!😊