Grid variable pair

<< Click to Display Table of Contents >>

Navigation:  Reference Manual > Variables >

Grid variable pair

Grid variables are pairs of variables with special names that can be used to create Grid tables.

These two variables are used to build a Grid table and must be maintained as a pair with the same name.

A normal grid table uses VGRIDE_ to define the columns and VGRIDT_ as the text for the rows:

VGRIDE_name contains the "elements"

VGRIDT_name contains the "text"

From entry update

When setting up a project a Grid question set and the pair of grid variables can be created.

Once the first question has been completed you can use the Make grid tool from the Entry details window to create the grid question set and the two grid variables.

From main window

Grid variables can be created from the Main window menu using [Insert] [Make grid variables].

Before using this menu option you must select one of the following from the main window list of entries:

Select all the entries you wish to use as the rows in the grid table to be banked alongside each other

Select one entry from a Grid question set or Grid variable set to include all entries in the set.

In the second case the program will find all the entries in the set.

These entries (questions or variables) will then be used to create the two grid variables as follows:

The name is the part of the first entry name without the last special character and the number or letters that follow.

Note that the grid variables will be placed at the end of the list entries.  They should not be moved above the last question on the project because this means they cannot then be changed in Companion Reflect.

After the variables have been created they are opened in the Entry details window for variable so that the text in both can be changed as appropriate.

VGRIDE_ (elements)

Each response in this variable determines which entry will be used as the rows.  The way the program determines this is to use the first entry referred to in the response definition.

When the VGRIDE_ variable is created it will make each response the relevant entry with "/nb" or "/nu" depending on the type of entries concerned.  You can change these definitions but you must leave the reference to the row entry as the first entry referred to.

The definition of each response serves the following purposes:

The text assigned to the response is used on the table as normal

The first referred to entry in the definition will be used as the rows in this column

The definition will be used to determine which records are included in the column

IMPORTANT: Each entry to be used as the rows must be the same type. Single-coded and multi-coded entries can be mixed but the number of responses must be the same.

If not all records have answered some of the questions and you want everyone to be in each column you cannot change the definition to be T (true).  There are several ways to deal with this:

1.The simplest method is to add a supplemental reject response to the entries being used.

2.Define a filter called TRUE with the definition T (true) and add +$TRUE/1 to each response.

3.Change the definition to be $entry/nb+$entry/b or $entry/nu+$entry/u as appropriate.

Once created you can add or remove responses (table columns) as you wish.  For example you may wish to use the same entry in three separate columns (total, males, females):

The original response will be something like $q1a/nb with a text of "Brand A".

You add a following response as $q1a/nb.$gender/1 with a text of "Brand A males".

You add a another response as $q1a/nb.$gender/2 with a text of "Brand A females".

All three columns will use $q1a as the rows because it is mentioned first in each definition, however the records included in each column will differ.

Even if you are happy with the responses in VGRIDE_ you may want to change the entry text and response texts because these will be used on any grid table using this grid variable pair.

VGRIDT_ (texts)

This entry is only used to assign the row texts to a grid table using the relevant VGRIDE_.  For single-coded and multi-coded rows all the definitions will be false.

When creating tables the VGRIDT_ entries are not listed.  Grid tables are created using the VGRIDE_ variables.

You may wish to change the entry and response texts as appropriate.

IMPORTANT: You must not add or remove responses from VGRIDT_ variables.