List Functions

Top  Previous  Next

 

Sawtooth Script:

Description:

ADD (ListName)

ADD (ListName, Member#)

ADD (ListName, StartMember#, EndMember#)

Adds members from a specified list to the end of the constructed list.

More info.

AddSorted (QuestionName)

AddSorted (QuestionName, intDirection)

 

Adds members rated/ranked within a multi-part radio/rank/numeric question to a constructed list, in ascending or descending order.  Specify a 0 for intDirection to indicate descending order; specify 1 for ascending order.

AIC (QuestionName)

AIC (QuestionName, Member#)

AIC (QuestionName, StartMember#, EndMember#)

Add If Chosen: Adds members chosen in a select-type question onto a new constructed list. More info.

 

AIE (QuestionName, Value)

Add If Equal: Adds members in a grid numeric, grid constant sum, grid ranking, grid with all radio buttons, constant sum, or ranking question that were given answers equal to a specific value.

More info. (Also see Loop functions).

AIG (QuestionName, Value)

Add If Greater: Adds members in a grid numeric, grid constant sum, grid ranking, grid with all radio buttons, constant sum, or ranking question that were given answers greater than a specific value.

More info. (Also see Loop functions).

AIL (QuestionName, Value)

Add If Less: Adds members in a grid numeric, grid constant sum, grid ranking, grid with all radio buttons, constant sum, or ranking question that were given answers less than a specific value.

More info.  (Also see Loop functions).

ANC (QuestionName)

ANC (QuestionName, Member#)

ANC (QuestionName, StartMember#, EndMember#)

Add if Not Chosen: Adds members not chosen in a select-type question onto a new constructed list.

More info.

ANE (QuestionName, Value)

Add if Not Equal: Adds members in a grid numeric, grid constant sum, grid ranking, grid with all radio buttons, constant sum, or ranking question that were given answers not equal to a specific value.

More info. (Also see Loop functions).

DisplayListLabels (ListName, "SeparatorText",

 "FinalSeparatorText")

Returns a string with every list item separated by "SeparatorText" with "FinalSeparatorText" prior to the last list item.  For example: DisplayListLabels (fruitlist, "," , "and") returns: grape, peach, and cherry.

FormatListLabels (ListName,

 "BeforeText", "AfterText")

Returns a string with all list items joined together with "BeforeText" before each item and "AfterText" after each item.  For example "<li>" and "</li>" as BeforeText and AfterText returns a bulleted list.

INSERT (TargetPosition#, ListName)

INSERT (TargetPosition#, ListName, Member#)

INSERT (TargetPosition#, ListName,

StartMember#, EndMember#)

Inserts members from a specified list to an exact position within a constructed list.

More info.

ListHasParentMember (ListName, ParentMember#)

 

Is true if the specified parent member exists in the specified list.

More info

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.

More info.

ListMin (Value)

Controls the minimum length of a list.

More info.

 

ListValue (ListName, Member#)

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

ListValuesArray (ListName)

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

Loop Functions for Lists

Click this link for available functions.

Mirror (ListName)

Mirror (ListName, Offset)

Adds list members from the parent list that correspond to the list values in ListName.

More info.

Randomize ()

Randomize (SeedValue)

Randomize (StartMember#, EndMember#)

Randomize (SeedValue, StartMember#, EndMember#)

Randomizes the members of a constructed list.

More info.

Remove (ListName)

Remove (ListName, Member#)

Remove (ListName, StartMember#, EndMember#)

 

Removes the members in the specified list from the constructed list.

More info.

Reverse ()

Reverses the members in a list.  For example, list members A, B, C, D when reversed become D, C, B, A.

RIC (QuestionName)

RIC (QuestionName, Member#)

RIC (QuestionName, StartMember#, EndMember#)

Remove If Chosen.  Removes items from the list that were chosen in QuestionName.

SetListLength (Value)

Controls the length of a list.

More info.

SortByLabel ()

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

SortByValue ()

Sorts the members in a constructed list with respect to their natural order (lowest to highest value) from their parent predefined list.  For example, list members with values 5, 3, 2, 7 would be sorted as 2, 3, 5, 7.

 

 

 

 

 

Page link: http://www.sawtoothsoftware.com/help/lighthouse-studio/manual/index.html?listfunctions.html