Description
Find selectedLabel in each using zero-based indexes, return knownInBoth, and compute second minus first position only when both contain it.
Survey display order, self-description, missingness, and record support are distinct research properties. Literal tokens and counts can preserve those distinctions without inferring a person's identity, preferences, or the meaning of an unprovided response.
Find selectedLabel in each using zero-based indexes, return knownInBoth, and compute second minus first position only when both contain it.
When to use this tool
Use Self Report Option Position Gap when you need a transparent survey-record, display-order, or time-use calculation.
How to use the tool and how it works
- Enter firstOptions, secondOptions, selectedLabel. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read firstIndex, secondIndex, knownInBoth, positionGap. Inspect knownInBoth before interpreting the associated values.
Require unique labels within each of two option arrays. Find selectedLabel in each using zero-based indexes, return knownInBoth, and compute second minus first position only when both contain it.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstOptions | First Options | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| secondOptions | Second Options | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| selectedLabel | Selected Label | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| firstIndex | Zero-based first-array lookup or -1 for absence. | Required. Safe integer. |
| secondIndex | Zero-based second-array lookup or -1 for absence. | Required. Safe integer. |
| knownInBoth | Known In Both | Required. Boolean. |
| positionGap | Second index minus first only when both are known, otherwise zero placeholder. | Required. Safe integer. |
{
"input": {
"firstOptions": [
"A",
"B"
],
"secondOptions": [
"B",
"A"
],
"selectedLabel": "A"
},
"output": {
"firstIndex": 0,
"secondIndex": 1,
"knownInBoth": true,
"positionGap": 1
}
} Limitations and assumptions
- An absent label has index -1 and positionGap zero is then a placeholder. Exact string matching measures display-order change, not a difference between identities or attitudes.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use the study's consent, vocabulary, missingness, and disclosure methodology for interpretation. Retain self-described information and assess sampling and privacy separately from local record arithmetic.
References
Similar or alternative tools
- Survey Option Position Share
Return (index-origin)/(optionCount-1) when more than one option exists; otherwise return zero with defined false.
- Self Report Category Display Index
Return listed according to exact membership and displayIndex from zero-based indexOf.