Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Lowest Rank labeled

Hi,

I have 2 Questions R1,R1a with the same list and then question R1b which is a ranking question to rank 5   from what selects in R1 and R1a so i did a constructed list using AIC

After that there are 2 question one to ask why you choose this as first Rank (R1c) and other why you choose this as least Rank (R1d),

It work fine if there are 5 ranked but if it is less it doesn't work, is there any solution
asked Dec 25, 2018 by Ossama

1 Answer

0 votes
Create a constructed list as follows ...

Note 1: Let's call this constructed list R1bHighLowList.
Note 2: R1bHighLowList will use the same parent list as R1 / R1a.
Note 3: I have assumed the parent list used at R1 and R1a is called R1List.
Note 4: I have assumed the constructed list used at R1b is called R1bRankList.
Begin Unverified Perl
 
 my $i=1;
 my $R1b_Max=0;
 
 $R1b_Max=LISTLENGTH("R1bRankList"); 
 
 for($i=1; $i<=LISTLENGTH("R1List"); $i++)
  {
   if (VALUE("R1b_".$i)==1)
    {  
     ADD("R1List",$i);
    }  
  }

 for($i=1; $i<=LISTLENGTH("R1List"); $i++)
  {
   if (VALUE("R1b_".$i)==$R1b_Max)
    {  
     ADD("R1List",$i);
    }  
  }
 
End Unverified

This constructed list (R1bHighLowList) will store two items ...
1st item: Highest ranked item. To display this item, insert [%ListLabel(R1bHighLowList,1)%] in the script of any question.
2nd item: Lowest ranked item. To display this item, insert [%ListLabel(R1bHighLowList,2)%] in the script of any question.

I have just tested this and all works fine. Best of luck.
answered Dec 26, 2018 by Paul Moon Platinum (76,050 points)
edited Dec 26, 2018 by Paul Moon
...