SurveyQuery
The SurveyQuery class is the main class when defining queries towards the survey data. These queries are mainly used to get aggregate survey data. When working with raw-data, the TransferDef object model should be used.
The SurveyQuery class can either hold a delete statement or a collection of select statements. More than one select statement in the collection, means that the select statement are a part of a UNION.
This object model does not contain a GROUP BY clause. This is because setting GroupBy to true for select items, puts the item in the GROUP BY clause as well as the SELECT clause.
A SurveyQuery can be used for two main purposes:
-
Directly running queries towards the confirmit survey data.
-
Defining data-point content when building report definitions.
Some of the classes in the SurveyQuery object model are only meant to be used when building Result:
-
Categorization and all classes inheriting from this class.
-
Category and all classes inheriting from this class.
The leaf nodes in a survey query are one of these objects:
-
QueryConstant - a constant expression.
-
QueryField - a field in the survey database.
-
QueryForm - a form in the survey schema.
The semantics of QueryForm and QueryField are both straight forward, while the semantics of a QueryForm is a little more complex when using forms with more than one field. See QueryForm for further explanation.