List Functions

Top  Previous  Next

 

Function

Description

Add (ListName)

Add (ListName, Position#)

Add (ListName, StartPosition#, EndPosition#)

Adds items from a specified list to the end of the dynamic list.  

 

Additional Help

AddSorted (QuestionName)

AddSorted (QuestionName, Direction)

Adds list items rated within a constant sum or ranking question to the dynamic list, in ascending or descending order. Specify a 0 for Direction to indicate descending order (this is the default); specify 1 for ascending order.

AIC (QuestionName)

AIC (QuestionName, ListItem#)

AIC (QuestionName, StartListItem#, EndListItem#)

 

AIC stands for "Add If Chosen". It adds list items selected in a select or grid question onto a dynamic list. Optional parameters control which list items from the source list are considered.

 

Additional Help

AIE (QuestionName, Value)

ANE (QuestionName, Value)

AIL (QuestionName, Value)

AIG (QuestionName, Value)

 

Adds list items from a question that were given answers equal to (AIE), not equal to (ANE), less than (AIL) or greater than (AIG) a specific value.

 

The QuestionName must be a grid (with "single response" selected), numeric grid, constant sum, or ranking question.

 

Additional Help

ANC (QuestionName)

ANC (QuestionName, ListItem#)

ANC (QuestionName, StartListItem#, EndListItem#)

ANC stands for "Add If Not Chosen". It adds list items not selected in a select or grid question onto a dynamic list. Optional parameters control which list items from the source list are considered.

 

Additional Help

INSERT (TargetPosition#, ListName)

INSERT (TargetPosition#, ListName, Position#)

INSERT (TargetPosition#, ListName, StartPosition#, EndPosition#)

Inserts list items from a specified list to an exact position (TargetPosition) within a dynamic list. If a list item to be inserted already exists in the dynamic list, it is first removed from the list and then added at the indicated position. Optional parameters control which items from the list are inserted.

ListLabel (ListName, Member#)

Returns the label of a specified member number in a list.

ListLabelsArray (ListName)

Returns a comma-separated list of member labels enclosed in quotes.

ListLength (ListName)

Returns the number of members in the list.

ListMax (Value)

 

Controls the maximum length of a list. For example, if a 5 is entered for Value then all items after the first 5 items in the list are removed.

ListMin (Value)

Controls the minimum length of a list. To ensure a minimum list length additional items from the source list are randomly added to the bottom of the list if needed. "Other specify" and "None of the above" items are not randomly added to the list.

ListValue (ListName, Member#)

Returns the list member position from the original parent list for the specified member# on the specified dynamic list.

ListValuesArray (ListName)

Returns an array of list positions from the original parent list for the specified dynamic list (example: [1, 4, 6]).

Mirror (ListName)

Mirror (ListName, Offset)

Adds list items from the source list that correspond to the list values in ListName. An Offset can be specified to select items a specified distance away from the values in ListName.

Randomize ()

Randomize (SeedValue)

Randomize (StartPosition#, EndPosition#)

Randomize (SeedValue, StartPosition#, EndPosition#)

Randomizes the items in a dynamic list. Specifying a StartPosition and EndPosition allow you to control which items are randomized.  

 

Using a particular SeedValue ensures that you can obtain the same randomization across different lists (containing the same number of items) for the same respondent.

Remove (ListName)

Remove (ListName, Position#)

Remove (ListName, StartPosition#, EndPosition#)

Removes items specified in ListName from the dynamic list. Optional parameters control which items from ListName are removed.

Reverse ()

 

The order of the items is reversed such that the last item in the list becomes the first item etc. For example Red, Green, Blue, Orange becomes Orange, Blue, Green, Red.

RIC (QuestionName)

RIC (QuestionName, ListItem#)

RIC (QuestionName, StartListItem#, EndListItem#)

RIC stands for "Remove If Chosen". Removes all of the items selected in QuestionName from the list. Optional parameters control which list items from the source list are considered.

SetListLength (Value)

Ensures that the list length is equal to Value. If more items than Value are in the list then extra items at the bottom of the list are removed (similar to ListMax). If less items are in the list than specified by Value then additional items are randomly added (similar to ListMin).

SortByLabel ()

Sorts a list based on the list labels. Numbers are sorted below letters.

SortByValue ()

 

Sorts a list with respect to the source list. For example, list members with values 5, 3, 2, 7 would be sorted as 2, 3, 5, 7.

 

 

Additional List Function Details

 

Add

 

Add is used to add list items to the end of a dynamic list.

 

Add (ListName)

Add (ListName, Position#)

Add (ListName, StartPosition#, EndPosition#)

 

ListName is the name of the list that you want to add to your dynamic list. It can be either a regular list or another dynamic list with the same source list as the current list that you are building. If only the ListName is specified then all of the list items from that list will be added to this dynamic list.  

 

Specifying Position# (optional) allows you to add a specific item from the list specified by the ListName to your dynamic list. For example:

 

Add (ColorList, 3)

 

would add the 3rd item in ColorList to your dynamic list.

 

StartPosition# and EndPosition# (optional) are used to designate a range of list items to add to your dynamic list.  

 

If your dynamic list already contains the list item to be added, then the duplicate list item is not added to the list. The original list item remains in its position.

 


 

AIC and ANC

 

Adds list items chosen (AIC) or not chosen (ANC) in a select or grid question onto the dynamic list. AIC stands for "Add If Chosen" and ANC stands for "Add if Not Chosen."

 

AIC (QuestionName)

AIC (QuestionName, ListItem#)

AIC (QuestionName, StartListItem#, EndListItem#)

 

ANC (QuestionName)

ANC (QuestionName, ListItem#)

ANC (QuestionName, StartListItem#, EndListItem#)

 

The question named must be a select or grid question (with "single response" or "multiple response" selected). If from a grid question, appropriate row numbers must be included in the question label, for example Q1_r1. This would include all of the column items selected in the first row of the grid. The source list for a dynamic list created from a grid question must be set to the Column Labels list.

 

The last two arguments are optional and are used to designate a range of list items to add to the dynamic list. If these two arguments are omitted, all qualifying list members are added to the list. If only one argument is supplied, then only that one list item (if chosen or not chosen in QuestionName) is added.

 

The list item numbers always refer to the dynamic list's source list, not the particular position number that member happens to occupy in the list used in the referenced QuestionName.

 

List items are added to the dynamic list in the order they were displayed to the respondent.

 

If the current dynamic list already contains the list item to be added, then the duplicate list item is not added to the list. The original item remains in its position.

 

If the member to be added to a dynamic list is an Other Specify response, the text supplied by the respondent is added. This is an automatic and helpful feature. Technical Note: if there is just one Other Specify response in a dynamic list, but two or more questions (using the same source list) collect multiple answers for this same Other Specify member, there is a potential conflict if you try to add the Other Specify members across multiple questions onto a dynamic list. As functions are executed sequentially, the other response referred to by the last function is used. Using ADD or INSERT always forces the open-end box to appear with Other Specify responses.

 


 

AIE, ANE, AIL, AIG

 

Adds list items from a question that were given answers equal to (AIE), not equal to (ANE), less than (AIL) or greater than (AIG) a specific value.

 

AIE (QuestionName, Value)

ANE (QuestionName, Value)

AIL (QuestionName, Value)

AIG (QuestionName, Value)

 

The QuestionName must be a grid (with "single response" selected), numeric grid, constant sum, or ranking question. If from a grid question, the source list for the dynamic list must be set to the Row Labels list.

 

All list items meeting the qualification are added to the dynamic list. In the case of a grid (with "single response" selected), each row item is added to the dynamic list based on the value selected in that row.  

 

For example, let's assume that you would like respondents to rank a list of colors from 1 to 5. You then want to build a dynamic list with only the items they rated above 3. This could be setup in a grid question (named Q1) with a list of colors as the row labels and items 1 to 5 as the column labels. Assume the following colors as the grid row labels:

 

1 - Red

2 - Green

3 - Blue

4 - Orange

 

If Green was rated a 4 and Orange a 5 (with all other colors being 3 or less) then this instruction:

 

AIG (Q1, 3)

 

would produce this list:

 

2 - Green

4 - Orange

 

 

 

Page link: https://www.sawtoothsoftware.com/help/discover/manual/index.html?list_functions.html