MaxDiff Functions are only applicable in studies containing MaxDiff exercises. The functions below are useful when advanced researchers want to customize the format for their MaxDiff questions.
Sawtooth Script: 
Description: 
MaxDiffDesignLabel (ExerciseName_MaxDiffQuestionName, Position#) 
Returns the item text for the specified MaxDiff question for the specified Position#. This function is used when researchers want to customize the format of their MaxDiff questions. 
MaxDiffDesignValue (ExerciseName_MaxDiffQuestionName, Position#) 
Returns the item value for the specified MaxDiff question for the specified Position#. This function is used when researchers want to customize the format of their MaxDiff questions. 
MaxDiffRankAttLabel(ExerciseName, Rank#)

Returns the list item label for the item with the rank specified. So a rank of 1 would return the list item label with the highest maxdiff logit score. More info. 
MaxDiffRankAttValue(ExerciseName, Rank#)

Returns the list item value for the item with the rank specified. So a rank of 1 would return the list item value with the highest maxdiff logit score. More info. 
MaxDiffRLH(ExerciseName) 
Returns the RLH (Root Likelihood) fit statistic for the logit estimation. More info. 
MaxDiffRSQ(ExerciseName) 
Returns the RSQ (Pseudo RSquared) fit statistic for the logit estimation. More info. 
MaxDiffScore(ExerciseName, ItemIndex) 
Returns the maxdiff logit score for the ItemIndex of the list associated with ExerciseName. More info. 
MaxDiffCurrentSet() 
Returns the index number for the ith MaxDiff set (question) in the exercise. For the first set it will return a 1, the second one a 2, etc. Must be used inside of the MaxDiff question.

MaxDiffTotalSets() 
Returns the total number of MaxDiff sets (questions) in the current exercise. Must be used inside of a MaxDiff question.

MaxDiffVersion () 
Returns the design version number and question name. This function is useful when creating paperandpencil interviews involving multiple versions. (Example: D1, TMXDIFF_1). Only available within a MaxDiff task. 
For additional flexibility in Sawtooth Scripting, see the Unverified Perl documentation.