DatStat Illume 4.5 SDK Class Reference

WebServiceContext.ExecuteQuery Method (SDK_Query, Int32&)

Executes the query defined in the SDK_Query parameter and returns the results in a DataSet.

The contents of the DataSet are determined by the QueryResultType.

public DataSet ExecuteQuery(
   SDK_Query query,
   out Int32& rowCount
);

Parameters

query
The SDK_Query to be executed.
rowCount
The number of rows returned from the query.

Return Value

A DataSet containing tables as requested by the QueryResultType property of the query parameter or null if the QueryResultType property of query is set to None.

Remarks

The DataSet returned by this method may be null if the QueryResultType property of query is set to None. This is most efficient if attempting to establish the existence of any matching submissions by simply refering to the rowCount out parameter.

If the QueryResultType of query is set to Raw, the DataSet returned will contain a DataTable whose name is given by the RawDataTableName property of query. This table will contain a column for each survey variable requested in the query, and a row for each survey submission.

If the QueryResultType of query is set to Summary, the DataSet returned will contain a DataTable whose name is given by the SummaryDataTableName property of query. This table will have the following structure (order may change):


Column NameData TypeDescription
IsAggregateBooleanIs this row an aggregate (i.e. 'roll-up') summary?
VariableStringThen name of the survey variable.
ValueCodeStringThe specific value code being summarized if there is a response scale associated with the survey variable.
xt1_VariableString The name of the cross-tab variable if specified.
xt1_ValueCodeString The specific value code of the cross-tab variable being summarized.
Cross-tab variables MUST have a response scale.
CountInt32The number of responses.
PercentageDecimalThe percentage of responses with respect to the total number of responses.
MinStringThe minimum value.
MaxStringThe maximum value.
SumDoubleThe sum of all responses.
MeanDoubleThe mean.
MedianDoubleThe median.
VarianceDoubleThe variance.
StdDevDoubleThe standard deviation.
Quartile1DoubleThe first quartile.
Quartile3DoubleThe third quartile.

CAUTION    When using the summary table, do not rely on the order of the columns given above as they may change with future releases of the SDK.

The rows present in the summary table will be dependent on the nature of the survey variables specified in the select list of the query. If the survey variable has an associated response option scale, the table will reflect statistics for each possible value of the response option scale as well as a row representing the aggregate of all possible response option scale values.

The cross-tab variable and value code columns are prefixed with "xt1_" to allow for future expansion to multiple cross-tab variables.

For example the following data may be returned for a query with a single variable called SEX which has a response option scale defined as [0 = "Male"] and [1 = "Female"].


Column NameRow #1Row #2Row #3
IsAggregateTrueFalseFalse
Variable"SEX""SEX""SEX"
ValueCodeDBNull01
xt1_VariableDBNullDBNullDBNull
xt1_ValueCodeDBNullDBNullDBNull
Count22139
PercentageDBNull59.09...40.90...
Min0DBNullDBNull
Max1DBNullDBNull
Sum9DBNullDBNull
Mean0.40...DBNullDBNull
Median0DBNullDBNull
Variance0.25...DBNullDBNull
StdDev0.50...DBNullDBNull
Quartile10DBNullDBNull
Quartile31DBNullDBNull

If the above example were extended to include a cross-tab variable called SMOKER which has a response option scale defined as [2 = "Yes"] and [1 = "No"], the table would be extended to include aggregate rows for each possible response to the main variable, SEX, across each of the possible responses for the cross-tab variable, SMOKER, including the null or 'unanswered' response. The full, non-aggregated, interval matrix of counts for each possible combination of the main variable by the cross-tab variable is included as well.


Column NameRow #1Row #2Row #3Row #4Row #5Row #6Row #7Row #8Row #9Row #10Row #11Row #12
IsAggregateTrueTrueTrueTrueFalseFalseFalseFalseFalseFalseFalseFalse
Variable"SEX""SEX""SEX""SEX""SEX""SEX""SEX""SEX""SEX""SEX""SEX""SEX"
ValueCodeDBNullDBNullDBNullDBNull00001111
xt1_VariableDBNull"SMOKER""SMOKER""SMOKER"DBNull"SMOKER""SMOKER""SMOKER"DBNull"SMOKER""SMOKER""SMOKER"
xt1_ValueCodeDBNull21DBNullDBNull21DBNullDBNull21DBNull
Count227105134549351
PercentageDBNullDBNullDBNullDBNull59.09...57.14...50.00...80.040.90...42.85...50.020.0
Min0000DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Max1111DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Sum9351DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Mean0.40...0.42...0.50.2DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Median000.50DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Variance0.25...0.28...0.27...0.2DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
StdDev0.50...0.53...0.52...0.44...DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Quartile10000DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull
Quartile31110.5DBNullDBNullDBNullDBNullDBNullDBNullDBNullDBNull

If more than one variable is selected for the query, the series of rows described above is simply repeated for each variable selected. If the select variable does not have a response option scale, only aggregate rows will be returned. When a statistic in an aggregate row cannot be computed, the value in the table will be DBNull.

If the QueryResultType of query is set to RawWithSummary, the DataSet returned will contain a DataTable whose name is given by the RawDataTableName property of query and a DataTable whose name is given by SummaryDataTableName as described above.

See Also

WebServiceContext Class | DatStat.SDK.WebServiceWrappers Namespace | WebServiceContext.ExecuteQuery Overload List