Desktop User Guides > Professional > Data management scripting > Creating new variables > Example 6: Creating nets
 
Example 6: Creating nets
Sometimes you might want to create net elements in a multiple response variable to show the number of respondents who chose one or more categories in a group of categories. In a single response variable a net is the same as a subtotal, which shows the number of responses.
You can create a net element anywhere in a categorical variable, however, they are generally placed immediately before or after the categories to which they refer. The following example creates a derived categorical variable based on the Remember multiple response variable.
Metadata(ENU, Question, Label, myInputDataSource)
RememberWithNets "Galleries remembered with nets"
categorical
{ExtinctLife "Extinct life forms and evolution"
expression ("remember * {Dinosaurs, Fossils, Evolution, Origin_of_species}"),
Dinosaurs "Dinosaurs"
expression ("remember * {Dinosaurs}"),
Fossils "Fossils"
expression ("remember * {Fossils}"),
Evolution "Evolution"
expression ("remember * {Evolution}"),
Origin_of_species "Origin of species"
expression ("remember * {Origin_of_species}"),
CurrentLife "Current life forms"
expression ("remember * {Fish_and_reptiles, Whales, Birds, Insects, Mammals, Botany, Human_biology}"),
Fish_and_reptiles "Fish and reptiles"
expression ("remember * {Fish_and_reptiles}"),
Whales "Whales"
expression ("remember * {Whales}"),
Birds "Birds"
expression ("remember * {Birds}"),
Insects "Insects"
expression ("remember * {Insects}"),
Mammals "Mammals"
expression ("remember * {Mammals}"),
Botany "Botany"
expression ("remember * {Botany}"),
Human_biology "Human biology"
expression ("remember * {Human_biology}"),
Theory "Theoretically themed exhibits"
expression ("remember * {Conservation, Ecology, Wildlife_in_danger}"),
Conservation "Conservation"
expression ("remember * {Conservation}"),
Ecology "Ecology"
expression ("remember * {Ecology}"),
Wildlife_in_danger "Wildlife in danger"
expression ("remember * {Wildlife_in_danger}")};
End Metadata
To add categories to existing variables. You could use a similar technique to add nets to an existing variable, see Example 7: Adding categories to existing variables.
This example is in the NewVariables.dms sample DMS file that is installed with the UNICOM Intelligence Developer Documentation Library. For more information, see Sample DMS files.
Requirements
UNICOM Intelligence Professional
See
Creating new variables