Use Punch logic to assign an answer or value to a respondent without requiring them to see a question. It allows you to "code" or categorize respondents by assigning them a value or answer that can be used in analysis.
⚠️ Note: Punch logic is recommended for advanced aytm Logic users.
Placement and Syntax
Punch logic can be applied to question text or answer options using the following elements:
- punch — the command
- reference — what the logic applies to (e.g.
Q2a1,Q5,Q6a2-5) - value as value — what value to record for the respondent (e.g.
5 as value) — for applicable question types - "value" as comment — what comment to log (e.g.
"n/a" as comment) — for applicable question types - if condition — apply the command only under certain conditions (e.g.
if gender='f',if Q1a4)
[punch reference, value as value, "value" as comment if condition] Example: [punch Q2a1, 5 as value, "n/a" as comment, if Q1a3] Result: Q2A1 is given a value of 5 with the comment "n/a" if the respondent selects A3 for Q1
Order of Operations
The punch command is applied after show/hide logic (if any) and randomization.
⚠️ Note: Different question types have different syntax rules for punch. Multiple punch logic statements within a single answer option are not supported — if there are multiple conditions, all must be contained in a single logic string.
[punch]
[punch 5 as value, 'lorem ipsum' as comment]
[punch Q1A2PV as value if Q1A2pv=1]
[punch Q1SQ2A3, 5 as value, 'lorem ipsum' as comment if Q1A2-4]
[punch Q1A2, var_number as value, var_string as comment]
[punch if PQ1A1 and age>=18 and age<=24]Supported Question Types
| Question Type | Value | Comment |
|---|---|---|
| Radio buttons | No | Yes |
| Checkboxes | No | Yes |
| Reorder / Side-by-Side | Yes — means order number | No |
| Distribute | Yes — mandatory; must be ≥0 and ≤ question's sum | No |
| Star rating | Yes — mandatory; must be within stars range (e.g. 1–5), or 0 if N/A enabled | No |
| Smiley rating | Yes — mandatory; midpoint = 0, left = negative, right = positive (range depends on smile count) | No |
| Open Ended | No | Yes — mandatory unless question is optional |
| Form | No | Yes — mandatory unless question is optional |
| Instruction text / Video / Image | No | No |
| Slider | No | No |
| Progressive Matrix | No | Yes |
Use Case: Punch a Radio Button Question
Q9 is used to segment respondents into two binary groups based on their response to Q8. Punch logic is added to the answer options in Q9 so that respondents don't see Q9, but researchers can see the recorded data on the Results page for quick filtering.
Use Case: Punch a Reorder Question
Respondents who select only one answer in Q4 are automatically sent through Q5 without seeing it — since they'd have only one option to rank. Their Q4 selection is automatically recorded as their top rank in Q5.
Use Case: Punch a Distribute Question
Respondents who select only one answer in Q6 are automatically sent through Q7 without seeing it — since they'd have only one option to allocate a percentage to. Their selection is automatically given 100% in Q7.