The question object
The question object in AskiaScript allows you to access information stored in a question, or its associated data. For example, to extract the long caption of the question, you might use:
- Gender.LongCaption (where the question shortcut is "Gender")
- ^Favourite brand^.LongCaption (where the question shortcut is "Favourite brand". We must use the carets around the shortcut when the shortcut contains spaces).
Although the question object in AskiaAnalyse is similar to the question object in AskiaDesign, there are some differences. In askiadesign, the question refers to a given data point, i.e. an interview and a given loop item. In AskiaAnalyse, it depends:
- in a sub-population type (or similar) script, the question refers to the current interview (or level), available through the
Value property as in ??Gender??);
- in a calculation arithmetic script (or similar), the object refers to all responses of the questions, available through the
Data property.
Properties
The question object has the following properties:
- Shortcut (returns a string)
- LongCaption (returns a string)
- ShortCaption (returns a string)
- MinValue (returns a number)
- MaxValue (returns a number)
- MinDate (returns a Number)
- MaxDate (returns a number)
- Responses (returns a Response Array)
- Children (returns an Array of Questions)
- Parent (returns a Question)
- PreviousQuestion (returns a Question). Allows iterating through the structure of the survey.
- NextQuestion (returns a Question). Allows iterating through the structure of the survey.
- Index (returns a number)
- Data (returns a DataObject). This returns the data in the original level of the question.
- Value (retuns a Variant). Note that this is available only in interview type scripts.