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 installed into 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.
This topic lists the scripts that contain information on how to generate various types of tables using UNICOM Intelligence Professional Tables Option.
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
Automatically generate summary statistics (mean, standard deviation, etc.) for numeric variables
-
AllFieldsAndShowOpenEnds.mrs
Automatically categorize numeric variables, or generate summary statistics (mean, standard deviation, etc.) depending on the number of unique answers
-
AutoCategorizeWordTopLines.mrs
Tabulating boolean variables
To
See
Sample script
Automatically categorize boolean variables into True and False categories
-
AllFieldsAndShowOpenEnds.mrs
 
-
AutoCategorizeWordTopLines.mrs
Automatically 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 to 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
Working with Quancept files
QuanceptTables.mrs
Working with Quantum files
QuantumTables.mrs
Working with Quanvert files, and working with a built-in base element
QuanvertTables.mrs
Working with data from an RDB database
RDBTables.mrs
Working with database questions.
CreatingTablesBasedOnDatabaseQuestions .mrs
Working with .SAV files
SAVTables.mrs
Working with Surveycraft files
SurveyCraftTables.mrs
See also
Alphabetical list of sample table scripts
Running the sample table scripts
Table scripting