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 <level_id> variable. The function takes the name of the <level_id> and returns the value of that variable down-leveled into the grid level.
Syntax
"EvaluateDerivedIteration(<level_id>)
Parameters
<level_id>
Type: Text
The variable that identifies the current iteration in the grid. This is typically the <level_id> variable.
(return)
Type: None
The value of variable at the parent level that has the same name as the current iteration.
Notes
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 <level_id> 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 IDs) 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