Use Punch logic to record an answer for a respondent without showing them the question. It lets you "code" or categorize respondents by assigning them an answer or value that you can use in analysis.
⚠️ Note: Punch logic is recommended for advanced aytm Logic users.
In This Article
- Placement and Syntax
- When Punch Skips a Question
- Order of Operations
- Supported Question Types
- Examples
- Use Case: Punch a Radio Button Question
- Use Case: Punch a Reorder Question
- Use Case: Punch a Distribute Question
Placement and Syntax
A punch command is made of these parts. Only punch itself is always required.
- punch: the command
-
reference: the answer, row, or question to fill (for example
Q2A1,Q4SQ2, orQ5). If you leave it out, the command fills the element it's written on. -
value: a number to record, written as
5 as value. Only some question types take a value. -
comment: text to record, written as
"n/a" as comment. Only some question types take a comment. -
if condition: apply the command only when the condition is met (for example
if gender = 'f'orif Q1A4)
[punch reference, value or comment if condition] Example: [punch Q2A1, "n/a" as comment if Q1A3] Result: Q2A1 is selected with the comment "n/a" if the respondent selected A3 in Q1
Keep these rules in mind, or the editor flags the command as an error:
- Write the command in the question it fills. A punch in Q1 can't fill Q2. You can write it in the question text, an answer, a row, or any other field of that question.
-
Use a single reference, not a range.
[punch Q6A2-5]isn't allowed. To fill several answers, add a punch to each one. Ranges are fine inside theifcondition. - Use a value or a comment, never both. No question type accepts both in one command. See Supported Question Types for which one each type takes.
-
Don't put a comma before
if. Write[punch Q2A1 if Q1A3], not[punch Q2A1, if Q1A3].
💡 Tip: You can add several punch commands to the same answer or row, each with its own condition. The first one whose condition is met (and whose value is valid) is used.
When Punch Skips a Question
The question is skipped only when the punch commands that apply give a complete, valid answer. Otherwise the respondent simply sees the question and answers it as usual.
- Radio buttons: the first punched answer whose condition is met is selected, in the order the answers are shown. If no condition is met, the question is shown.
-
Checkboxes: every punched answer whose condition is met is selected, up to the question's maximum number of choices. If fewer are punched than the question's minimum, the question is shown. An N/A answer is recorded on its own.
[exclusive]logic isn't applied to punched answers. - Reorder, Side-by-Side, Distribute, Star rating, Smiley rating, Sliders, Progressive Matrix, and Forms: every item the respondent would see (each answer, row, or field) needs its own punch. If even one is missing or invalid, the question is shown.
- Open Ended: the comment must fit the question's minimum and maximum character limits.
- Forms: each comment must also match its field's input format.
Order of Operations
Punch is applied after show/hide logic and randomization. So it works with the answers and rows the respondent would actually see. Items hidden by [hide if...] or [mask by...] don't need a punch.
Supported Question Types
Punch works only on the question types below. Any other type (for example Polarity Scale) shows the error "Punch command is not allowed in the question".
| Question type | Reference | Value | Comment |
|---|---|---|---|
| Radio buttons, Checkboxes | Answer (Q2A1) |
No | Only on an answer with an open-ended box. Required if the box is mandatory. |
| Screening questions (radio and checkbox) | Answer (PQ1A2) |
No | No |
| Reorder, Side-by-Side | Answer (Q5A1) |
Optional: the item's rank (1 = top). Give each item a different rank. | No |
| Distribute | Row (Q7SQ1) |
Required. Between 0 and the question's maximum, on one of the slider's steps. The values together can't go over the question's total. | No |
| Star rating | Row (Q3SQ1) |
Required. A whole number from 1 to the number of stars, or 0 for N/A when N/A is turned on. | No |
| Smiley rating | Row (Q3SQ1) |
Required. 2 smileys: −1 or 1. 3 smileys: −1, 0, or 1. 5 smileys: −2 to 2. Negative values are on the left. | No |
| Sliders | Row and answer (Q6SQ1A2) |
No | No |
| Progressive Matrix | Row and answer (Q6SQ1A2) |
No | Only on an answer with an open-ended box. Required if the box is mandatory. |
| Open Ended | Question (Q8) |
No | Required unless the question is optional |
| Forms | Field (Q8A1) |
No | Required unless the field is optional |
| Instruction text, Image, Video | Question (Q1) |
No | No. A plain [punch] skips the screen. |
💡 Tip: In Sliders, a plain
[punch]on an answer column selects that answer for every row. A punch that names a specific row (for example[punch Q6SQ1A2]) wins over the column punch for that row.
Examples
[punch] On an answer: selects that answer for every respondent who reaches the question. [punch if Q1A3] On an answer: selects that answer if the respondent selected A3 in Q1. [punch Q2A1, "n/a" as comment if Q1A3] In Q2 (A1 has an open-ended box): selects A1 with the comment "n/a". [punch 5 as value if Q1A2-4] On a Star rating row: gives the row 5 stars if the respondent selected any of A2-A4 in Q1. [punch Q5A2, 1 as value if Q4A2] In a Reorder question: ranks A2 first if the respondent selected A2 in Q4. [punch var_string as comment] In an Open Ended question: records the text stored in the variable var_string. [punch if PQ1A1 and age >= 18 and age <= 24] On an answer: selects it for 18-24-year-olds who selected A1 in PQ1.
Use Case: Punch a Radio Button Question
Q9 is used to segment respondents into two groups based on their response to Q8. Punch logic is added to the answer options in Q9, so respondents don't see Q9, but researchers can see the recorded data on the Results page for quick filtering.
⚠️ Note: Make sure the conditions cover every respondent. Anyone who matches none of them sees Q9.
Use Case: Punch a Reorder Question
Q5 asks respondents to rank the items they selected in Q4 and is masked by Q4. Respondents who selected only one item in Q4 would have just one item to rank. Punch logic records that item as their top rank, so they skip Q5. Because of the mask, those respondents see only one item in Q5, so a single punch covers every item they would see.
Use Case: Punch a Distribute Question
Q7 asks respondents to distribute 100% across the items they selected in Q6 and is masked by Q6. Respondents who selected only one item in Q6 would have just one item to allocate to. Punch logic gives that item 100%, so they skip Q7.