In this article
The XTab widget allows custom cross-tabulations of survey data, grouping related variables. It supports several question types and local/global sorting.
The XTab widget enables users to create custom cross-tabulations. It helps to segment survey data based on any available variable.
Example of an Xtab widget without a banner
widget xtab {
size: medium
tableSet {
include: surveyData.all()
order: AsSpecified
}
}
Users can create multiple levels using banners, which facilitates grouping and summarizing related variables.
The XTab widget currently supports the following types of questions:
Single.
Numeric.
Multi.
Rating (single with score).
Grid.
Multi grid.
Numeric list.
3dGrid.
Only these types of questions can be used in tableSets and banners within the XTab.
Additionally, you can enhance the table with labels, and the variables can be sorted locally and globally within the XTab.
For details of the properties and settings, refer to widget xtab in the CDL Reference Guide.
XTab Widget Banner
A banner in the XTab is a group of variables that you want to cross with tableSet variables, resulting in each variable forming a column in the output tables.
Example of an Xtab widget with a banner
The XTab currently supports "extended" banner syntax. You can define one or more banners, which determine the questions displayed as columns, and one or more headers within the XTab.
banner {
label: "My banner"
header {
variable: survey:q9
}
header {
label: "Age"
variable: survey:q1
}
}XTab Widget Statistics
Statistics in the XTab refers to the data displayed for various types of variables. Different sets of statistics are available for categorical (single and multiple choice), numeric, and rating (single choice with score) questions.
Please note that the CDL for statistics is currently in beta status, and the code may change in the future.
Categorical statistics
The following statistics can be applied for multi and single variables.
percents
count
significanceTest
For example:
categoricalStatistics {
statistic percents {}
statistic count {}
statistic significanceTest {
level: 80
}
}For each statistic, you can apply" format" and "view" fields.
Numeric statistics
The following statistics can be applied for numeric variables:
average
standardDeviation
standardError
significanceTest
For example:
numericStatistics {
statistic average {
label: "Avg"
}
statistic standardDeviation {
label: "StdDev"
}
statistic standardError {
label: "StdErr"
}
statistic significanceTest {
label: "SigTest"
level: 80
}
}For each statistic, you can apply "format", "view", and "label" fields. Additionally, for the significanceTest statistic, you can specify the level property.
Rating statistics
The following statistics can be applied to rating (single with score) variables:
percents
count
significanceTest
average
standardDeviation
standardError
For example:
ratingStatistics {
statistic count {}
statistic percents {}
statistic significanceTest {}
statistic average {}
statistic standardDeviation {}
statistic standardError {}
}The statistics for rating (single with score) variables combine statistics from categoricalStatistics and numericStatistics. They have the same CDL.
Statistic View
This is a special kind of view that can be applied to the statistic.
view statistic statisticView {
fontWeight: bold
color: "#FF2E04"
removeBrackets: true
}Advanced Configuration
For details of the properties and settings, refer to widget xtab in the CDL Reference Guide.