Desktop User Guides > Professional > Table scripting > Sample table scripts
 
Sample table scripts
The UNICOM Intelligence Developer Documentation Library comes with a number of sample mrScriptBasic (.mrs) files that demonstrate how to create tables using the UNICOM Intelligence Professional Tables Option. By default, these samples are in the [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\Tables folder. You need to have the UNICOM Intelligence Professional Tables Option to run these samples. Some of the samples have additional requirements.
For instructions on running the samples, see Running the sample table scripts.
Creating basic tables
To
See
Sample script
create a basic table
MyFirstTable.mrs
create a basic frequency table
MyFirstFrequencyTable.mrs
create tables with more than one variable on an axis
ConcatenatingAndNesting.mrs
MoreonConcatenatingAndNesting.mrs
create a banner for use in multiple tables
ReusingAxes.mrs
create profile tables to display verbatims and non-aggregated respondent data.
ProfileTables.mrs
Changing the information displayed in a table
To
See
Sample script
change the contents of a table cell
CellContents.mrs
change the information included in the base
BaseElements.mrs
change the information included in the base using an expression
SpecialElements.mrs
change the categories included in the base
IncludeInBase.mrs
specify the elements to display for a variable
ElementSpecifications.mrs
add subtotals, totals and statistic values to a table, create net elements
SpecialElements.mrs
hide zero values or rows/columns
ZeroValues.mrs
HideRules.mrs
show row percentages or column percentages depending on the orientation of a grid
-
AllFieldsAndShowOpenEnds.mrs
Adding filters
To
See
Sample script
create simple filters
MyFirstFilter.mrs
create global, default and table document filters
MoreOnFilters.mrs
modify the base element by applying filters
BaseElements.mrs
filter a series of tables on each category of a categorical variable
-
FilterOnAgeGroups.mrs
filter hierarchical data
HierarchicalFilters.mrs
Changing the table format
To
See
Sample script
add cell prefixes or suffixes
CellPrefixAndSuffixUsage.mrs
change the labels for an element
ElementSpecifications.mrs
change the formatting for labels using html
FormattedLabels.mrs
add images to labels
DisplayElementImages.mrs
change decimal places shown for an element
DecimalPlacesOnSummaryElements.mrs
sort the rows or columns of your tables
MyFirstSortedTable.mrs
sort complex tables
SortedTables.mrs
set up annotations for tables
Annotations.mrs
set up global table annotations
Annotations.mrs
Tabulating numeric variables
To
See
Sample script
create a table using numeric variables
NumericVariables.mrs
create bands from numeric variables
SpecialElements.mrs
show mean values of numeric variables
SpecialElements.mrs
create summary statistic tables for numeric variables by setting up standard axis expressions
AutoSummarizeNumerics.mrs
save axis expressions to the metadata
AutoSummarizeNumericsAndSave.mrs
create summary statistics table with statistics shown as elements
SummaryStatisticTables.mrs
generate summary statistics (mean, standard deviation, and so on) for numeric variables
-
AllFieldsAndShowOpenEnds.mrs
categorize numeric variables, or generate summary statistics (mean, standard deviation, and so on) depending on the number of unique answers
-
AutoCategorizeWordTopLines.mrs
Tabulating boolean variables
To
See
Sample script
categorize boolean variables into True and False categories
-
AllFieldsAndShowOpenEnds.mrs
AutoCategorizeWordTopLines.mrs
categorize text variables into code values
-
Categorize.mrs
CategorizeExample.dms
Tabulating text variables
To
See
Sample script
autocode text variables
NumericVariables.mrs
automatically categorize text answers to display one category for each unique answer
-
AutoCategorizeWordTopLines.mrs
autocode text questions or place individual answers in an html file and link to it from the table annotations
-
AutoCategorizeWordTopLines.mrs
embed the answers to text questions directly within your tables
-
AllFieldsAndShowOpenEnds.mrs
Working with grids and loops
To
See
Sample script
create simple grid tables
MyFirstGridTable.mrs
tabulate data at different hierarchical levels, and set population levels
HierarchicalData.mrs
set up tables for all categorical and grid questions at a specified level.
-
TabulateAllVariablesAtSpecifiedLevel.mrs
create grid tables from a grid question or a numeric loop
GridTables.mrs
create tables using slices from loops or grids
GridAndLoopSlices.mrs
combine two or more grid slices into a single category within the grid
CombineGridSlices.mrs
loop through fields and create grid tables for numeric variables within the grid
-
AutoSummarizeNumericsAndSave.mrs
data is collected as separate questions, instead of in a loop or grid, but the data is tabulated as if it is a grid
DerivedGridTables.mrs
Working with weighted tables
To
See
Sample script
work with weighted and unweighted bases
BaseElements.mrs
create tables using a weighting variable
WeightedTables.mrs
create weighted tables using dms scripting
DMSWeightedTables.mrs
Running statistical tests on a table
To
See
Sample script
apply a chi-square test
ChiSquareAndFisherTests.mrs
apply a cell chi-square test
CellChiSquareTests.mrs
apply a column proportions test
ColumnProportionsTest.mrs
apply a column means test
QuanvertTables.mrs
apply Fisher's exact test
ChiSquareAndFisherTests.mrs
apply a net difference test
NetDifferenceTest.mrs
apply a paired preference test
PairedPreferenceTest.mrs
apply a product difference test
ProductDifferenceTest.mrs
apply a T-test test
TTestTests.mrs
apply a Tukey test
TukeyTest.mrs
Exporting tables
To
See
Sample script
export tables to HTML files
HTMLExportOptions.mrs
export charts to HTML files
HTMLCharts.mrs
export tables and charts to Microsoft Word
WordExport.mrs
export to Microsoft Word using a customized Word template
-
AutoCategorizeWordToplines.mrs
export tables and charts to Microsoft Excel
ExcelExport.mrs
format Excel sheets from .mrs files
-
MSExcelFormatting.mrs
export to Microsoft PowerPoint
PowerPointExport.mrs
export a table to a comma-separated text file
TextExport.mrs
write the output from a table to a text file using the ADO recordset
CellValues.mrs
write the output from a table, including labels, to a text file using the ADO recordset
CellValuesAndLabels.mrs
Working with metadata
To
See
Sample script
understand the structure of a table
UnderstandingAxes.mrs
work with versions of a metadata file
WorkingWithVersions.mrs
RDBTables.mrs
calculate percentages based on respondents who were asked a question in a version compared to the number who answered
PercentageOnElementsAsked.mrs
create topline tables for simple categorical variables in the UNICOM Intelligence Interviewer - Paper routing if they have a short name
WorkingWithLabels.mrs
create tables in different languages stored in the metadata
WorkingWithLanguages.mrs
define a custom Japanese label
JapaneseLabels.mrs
Working with change tracker
To
See
Sample script
include functions that assist in modifying Table Object Model metadata
ChangeTrackerFunctions.mrs
modify metadata and save the modifications to a table document file
ChangeTrackerTest1_NewDocument.mrs
open a table document that includes change tracker records, modify the metadata, and save the modifications to a table document file
ChangeTrackerTest2_OpenDocument.mrs
Working with data in different file formats
To
See
Sample script
work with Quancept files
QuanceptTables.mrs
work with Quantum files
QuantumTables.mrs
work with Quanvert files, and work with a built-in base element
QuanvertTables.mrs
work with data from an RDB database
RDBTables.mrs
work with database questions
CreatingTablesBasedOnDatabaseQuestions .mrs
work with .SAV files
SAVTables.mrs
work with Surveycraft files
SurveyCraftTables.mrs
See also
Alphabetical list of sample table scripts
Running the sample table scripts
Table scripting