Examples on how to rotate a response list
Below are examples of ways to rotate a response list depending on how simple or complex the rotation needs to be. It is important to keep in mind the following things when rotating a response list.
- The rotate seed(s)must always be a predefined variable. It is recommended that the rotate seed be a hidden Variable question that only allows numeric data.
- The entire response list must be contained inside of a rotation block. In other words, the first thing in the response list will be !Rotate and the last thing in the list will be !EndRotate.
- You need to use the Recode_Rotate_Order command if you want to store the rotation order. See the solutions article on it for more information.
- If you are rotating a multiple language list, include the rotation commands only in the first language. See below for an example.
Simple rotation example
Simple Example just showing how to setup the rotation commands.
{ ROTSEED: HIDE!VARIABLE,NUMERIC_ONLY,10,10 }{ Q1:Which items do you use?!FIELD,,10!ROTATE,S,,ROTSEED01 Item 102 Item 203 Item 304 Item 405 Item 506 Item 607 Item 708 Item 809 Item 910 Item 10!ENDROTATE }
Simple rotation example keeping Other, Don’t know, and Refused at the bottom of the list.
You need to use the FIX command in order to hold the Other and Don’t Know type responses at the bottom of the list, since they cannot be outside of the rotation.
{ ROTSEED: HIDE!VARIABLE,NUMERIC_ONLY,10,10 }{ Q1:Which items do you use?!FLD,,11!ROTATE,S,,ROTSEED01 Item 102 Item 203 Item 304 Item 405 Item 506 Item 607 Item 708 Item 809 Item 910 Item 10!FIX91 Other(-)99 Don't Know !ENDROTATE }
You will get the following compile error if you try to define them outside of the rotation:
(ERROR #7880) Response codes in a rotated list are not allowed outside of a Rotate block.
**error** Use !Fix if you need to keep items unrotated at the bottom of the list.
Example of setting up a nested rotation
Example below rotates items 01 to 05 in one group, items 06 to 10 in a second group, and rotates the 2 groups. The DK response (99) is always held at the bottom.
{ ROTSEED: HIDE!VARIABLE,NUMERIC_ONLY,10,10 }{ ROTSEED2: HIDE!VARIABLE,NUMERIC_ONLY,10,10 }{ Q1:Which items do you use?!FLD,,10!ROTATE,S,,ROTSEED!ROTATE,S,,ROTSEED201 Item 102 Item 203 Item 304 Item 405 Item 5!ENDROTATE!ROTATE,S,,ROTSEED206 Item 607 Item 708 Item 809 Item 910 Item 10!ENDROTATE!FIX(-)99 Don't Know !ENDROTATE }
Example of setting up a nested rotation along with group and fix statements to get a more complex rotation sequence.
Just an example showing some of the complex rotations that can be created. In this case, the 2 major groups (01-07) and (08-14) are each rotated. In each group, the first items are rotated, but the 6th and 7th ones are held at the bottom of that group. The Don’t Know response (99) is always held at the bottom.
{ ROTSEED: HIDE!VAR,N,10,10 }{ ROTSEED2: HIDE!VAR,N,10,10 }{ Q1:Which items do you use?!FLD,,14!ROTATE,S,,ROTSEED!ROTATE,S,,ROTSEED201 Item 102 Item 203 Item 304 Item 405 Item 5!FIX,206 Item 607 Item 7!ENDROTATE!ROTATE,S,,ROTSEED208 Item 809 Item 910 Item 1011 Item 1112 Item 12!FIX,213 Item 1314 Item 14!ENDROTATE!FIX,1(-)99 Don't Know !ENDROTATE }
Example of rotating different parts of the response list, but not rotating the rotations
Since the entire list must be contained in a rotation, this gets a little tricky. You cannot put a FIX command after the first Rotation because the compiler will see that as negating the entire rotation and treat it as an error. You can however put a FIX command before the second rotation and that will hold it and all subsequent rotations along with all of the “special” responses at the bottom in their current positions effectively not rotating anything in the outer rotate.
{ ROTSEED: HIDE!VAR,N,10,10 }{ ROTSEED2: HIDE!VAR,N,10,10 }{ Q1:Which items do you use?!FLD,,14!ROTATE,S,,ROTSEED!ROTATE,S,,ROTSEED201 Item 102 Item 203 Item 304 Item 405 Item 506 Item 6!ENDROTATE!FIX07 Item 7!ROTATE,S,,ROTSEED208 Item 809 Item 910 Item 1011 Item 1112 Item 1213 Item 1314 Item 14!ENDROTATE(-)99 Don't Know !ENDROTATE }
Example ofrotating the list in a multiple language survey.
The typical approach to creating the response list for a multiple language survey is to have a separate section for each language separated by a [xx] language command. If you use that approach then you want to put the rotation pattern in only in the first rotation and all the subsequent languages will use the same rotation logic.
{ ROTSEED: HIDE!VARIABLE,NUMERIC_ONLY,10,10 }{ ROTSEED2: HIDE!VAR,N,10,10 }{ Q1:LEN English Text?LSP Spanish Text!FLD,,14[LEN]!ROTATE,S,,ROTSEED!ROTATE,S,,ROTSEED201 Item 102 Item 203 Item 304 Item 405 Item 506 Item 6!ENDROTATE!FIX07 Item 7!ROTATE,S,,ROTSEED208 Item 809 Item 910 Item 1011 Item 1112 Item 1213 Item 1314 Item 14!ENDROTATE(-)99 Don't Know !ENDROTATE [LSP]01 Item 1 in Spanish02 Item 2 in Spanish03 Item 3 in Spanish04 Item 4 in Spanish05 Item 5 in Spanish06 Item 6 in Spanish07 Item 7 in Spanish08 Item 8 in Spanish09 Item 9 in Spanish10 Item 10 in Spanish11 Item 11 in Spanish12 Item 12 in Spanish13 Item 13 in Spanish14 Item 14 in Spanish(-)99 Don't Know in Spanish}