Substitution Tokens

Sometimes, you may want to display the response to an earlier question or the result of a calculation. QDS allows you to do this through the use of substitution tokens. Substitution tokens may be used in Questions and Information Items, Edit Element message instructions, Report Elements, or response choices.

Substitution tokens are required within Table Elements. There are additional tokens that only apply in Report Elements. See Substitution Tokens in Reports.

Substitution Tokens Syntax

A Substitution token always begins with an ampersand (&); this indicates to QDS that a substitution needs to be made.

Valid Substitution Tokens

  • &Q: Inserts Question Number for the current Data Element
  • &P: Inserts Question Number Prefix for the current Data Element
  • &N: Inserts Question Number Integer for the current Data Element
  • &S: Inserts Question Number Suffix for the current Data Element
  • &C: Inserts Table Category Suffix for the current Data Element
  • &LBL: Inserts Table Category Label for the current Data Element
  • &TXT: Inserts Table Category Text for the current Data Element
  • &ALT: Inserts Table Category Alternate Text for the current Data Element
  • &[Variable Name]: Inserts value of a variable, where the variable name is entered within square brackets.

For example, to substitute the value for variable VAR, you would enter &[VAR].