Creating an iteration variable for looping in streams
You can use iteration variables to change the values of stream parameters or properties of selected nodes within a stream each time a loop is executed. For example, if your stream loop is analyzing car sales data and using Country of manufacture as the iteration key, you may have one graph output showing sales by model and another graph output showing exhaust emissions information. In these cases you could create iteration variables that create new titles for the resultant graphs, such as Swedish vehicle emissions and Japanese car sales by model. Use the Define Iteration Variable dialog box to set up any variables that you require.
To open the dialog box, either select the Add Variable... button in the bottom left corner of the Looping subtab, or right click on any node in the stream and select: .
To set up an iteration variable, complete the following fields:
Change. Select the type of attribute that you want to amend. You can choose from either Stream Parameter or Node Property.
- If you select Stream Parameter, choose
the required parameter and then, by using one of the following options,
if available in your stream, define what the value of that parameter
should be set to with each iteration of the loop:
- Global variable. Select the global variable that the stream parameter should be set to.
- Table output cell. To set a stream parameter to be the value in a table output cell, select the table from the list and enter the Row and Column to be used.
- Enter manually. Select this if you want to manually enter a value for this parameter to take in each iteration. When you return to the Looping subtab a new column is created into which you enter the required text.
- If you select Node Property, choose the
required node and one of its properties and then set the value you
want to use for that property. Set the new property value by using
one of the following options:
- Alone. The property value will use the iteration key value. See Creating an iteration key for looping in streams for more information.
- As prefix to stem. Uses the iteration key value as a prefix to what you enter in the Stem field.
- As suffix to stem. Uses the iteration key value as a suffix to what you enter in the Stem field
If you select either the prefix or suffix option you are prompted to add the additional text to the Stem field. For example, if your iteration key value is Country of manufacture, and you select As prefix to stem, you might enter - sales by model in this field.