Scripting > UNICOM Intelligence Function Library > Miscellaneous functions > EvaluateDerivedIteration
 
EvaluateDerivedIteration
Used by the derived grid feature to look up the value for the variable at the parent level with the same name as the supplied LevelID variable. The function takes the name of the LevelID and returns the value of that variable down-levelled into the grid level.
Syntax
"EvaluateDerivedIteration(LevelID)
Parameters
LevelID
Type: Text
The variable that identifies the current iteration in the grid. This is typically the LevelID variable.
(return)
Type: None
The value of variable at the parent level that has the same name as the current iteration.
Remarks
The EvaluateDerivedIteration function gets the value of the variable at the parent level that has the same name as the current iteration. Use it when creating derived grids, where each iteration of the grid is a parent level variable.
The function can be useful in the following situations:
You want to create grids from flat data, and you do not want end users to create these grids on their own.
You are scripting tables and want grids, but do not want to set them up in the user interface.
When setting up derived grids, keep the following tips in mind:
The nested variable must have a source type of sExpression.
The category list of the nested variable must contain the union of the categories referenced by the parent level variables, and the noDeriveElements property should be set up.
The grid categories (iterators) must match the actual “next level up” question names. This ensures that the LevelID can be matched to a question name.
The mlExpand property must be set. You cannot use this function on an unbounded level; the iterator must be categorical.
Examples
The following example creates a new derived grid variable that is based on three top level variables:
NEWGRID "" loop {
Rating_BrandA "BrandA",
Rating_BrandB "BrandB",
Rating_BrandC "BrandC
} fields
(
Rating "how do you rate this brand?" categorical [1]
{ use \\ratingList - } expression ("EvaluateDerivedIteration(LevelID)");
) expand grid;
The category names (category ID's) for the grid iterator match the question names of the top level questions they look up.
The expression EvaluateDerivedIteration(LevelID) is added to the Rating question inside the grid.
See also
Miscellaneous functions