Professional > Table scripting > Sample table scripts > Alphabetical list of sample table scripts
 
Alphabetical list of 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 in this folder:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\Tables
You need to have the UNICOM Intelligence Professional Tables Option to run these samples. Some of the samples have additional requirements.
For instructions to run the samples, see Running the sample table scripts.
This topic lists the scripts in alphabetical order.
Note In addition to these sample .mrs files, the UNICOM Intelligence Developer Documentation Library comes with some sample data management script (DMS) files that demonstrate creating tables in a DMS file. See Table scripting sample Data Management scripts for more information.
You can use the samples as a starting point when you develop your own table scripts. However, it is always advisable to work on a copy of the files rather than working on the sample files directly. This means you will avoid losing your work when you uninstall or upgrade to a new version of the UNICOM Intelligence Developer Documentation Library.
AllFieldsAndShowOpenEnds.mrs
This script demonstrates how to generate table syntax to summarize numeric variables, how to automatically categorize Boolean variables, how to change the cell contents to show row percentages in a grid table instead of the default column percentages if the default orientation of the grid requires this, and how to embed the answers to text questions directly within your tables. (Note that this is accomplished by accessing the UNICOM Intelligence Data Model using ADO.)
Annotations.mrs
Provides examples of setting up annotations to display information about your tables. See Annotations for more information.
AutoCategorizeWordTopLines.mrs
An advanced script that demonstrates how to intelligently define a table for a numeric question. This is accomplished by determining the number of unique answers to the numeric question (using the UNICOM Intelligence Data Model). If there are fewer than a specified number of unique answers, the script bands the numeric question, defining one band for each unique answer. If there are more than the specified number of unique answers, it makes a summary table. Similarly for text (open-ended) questions, the script determines the number of unique answers. If there are more than a specified number of answers, it displays the text answers themselves and if there are fewer than the maximum number of unique answers, it autocodes them, defining one category for each unique answer. The raw text answers are placed in a separate HTML file that can be URL-accessed from the Microsoft Word export. Note that this is an advanced feature and understanding this part of the script requires knowledge of XML, XSLT, and the MSXML DOM. This script also demonstrates using a customized Word template. To run the script, two files (TextAnswers.xsl and WordTopLines.dot) must be present in the specified folder (by default, this is [INSTALL_FOLDER]\IBM\SPSS\DataCollection\7\DDL\Scripts\Tables\Templates). Note that this script may not be suitable for text variables that store some non-alphabetic characters, such as line feeds.
AutoSummarizeNumerics.mrs
Provides an example of creating summary tables for all of the numeric variables in a data set. This is achieved by setting up standard axis expressions for all the numeric variables. See Creating axis expressions in your script for more information.
AutoSummarizeNumericsAndSave.mrs
This is similar to the AutoSummarizeNumerics.mrs sample except that the axis expressions are written to the metadata permanently and grid tables are created for the numeric variables nested inside a grid. See Creating axis expressions in your script for more information.
BaseElements.mrs
Provides examples of including and excluding cases in the base element, and shows how to hide the base element on a table. See Base element for more information.
CellChiSquareTests.mrs
Creates tables with Cell chi-square tests. For further information, see Example of the cell chi-square test.
CellContents.mrs
Creates nine tables that demonstrate using different types of cell contents. All of the tables crosstabulate the same two variables and are described in detail in Examples.
CellPrefixAndSuffixUsage.mrs
Shows how to define prefix and suffix properties for cell items. See Displaying prefixes and suffixes for cell items for more information.
CellValues.mrs
Shows how to write the recordset for a table to a text file. This is the first example in Working with the ADO recordset.
CellValuesAndLabels.mrs
Shows how to combine the recordset for a table with the element headings to write the complete table to a text file. This is the second example in Working with the ADO recordset.
ChangeTrackerFunctions.mrs
Includes functions that assist in modifying Table Object Model metadata. See Change Tracker: Functions for more information.
ChangeTrackerTest1_NewDocument.mrs
Modifies metadata and saves the modifications to a table document file. See Change Tracker: Modifying metadata in a new table document for more information.
ChangeTrackerTest2_OpenDocument.mrs
Opens a table document that includes change tracker records, modifies the metadata, and saves the modifications to a table document file. See Change Tracker: Modifying metadata in an existing Table Document for more information.
ChiSquareAndFisherTests.mrs
Creates tables with chi-square and Fisher's exact tests. For further information, see Example of the chi-square test and Example of Fisher's exact test.
ColumnProportionsTest.mrs
Creates tables with column proportions statistical tests. For further information, see Examples of the column proportions test.
CombineGridSlices.mrs
Shows how to combine elements that are grid iterations. See Combining grid slices for more information.
ConcatenatingAndNesting.mrs
Creates two tables using the same three variables. In the first table two of the variables are concatenated on the top axis and in the second table one of the variables is nested inside the other. See Concatenation and nesting for more information.
CreatingTablesBasedOnDatabaseQuestions.mrs
Demonstrates how to create tables that are based on Database Questions. See Creating tables based on database questions for more information.
DecimalPlacesOnSummaryElements.mrs
Shows how to specify decimal places for summary statistic elements. See Specifying Decimal Places for a Summary Statistic Element in the Element properties.
DerivedGridTables.mrs
Creates a number of tables that demonstrate creating .mdm derived grids and using derived grids in tables. See Derived grid tables for more information.
DisplayElementImages.mrs
Shows how to attach images to elements and export them to HTML or Microsoft Word files. See Displaying images for elements for more information.
DMSWeightedTables.mrs
This sample is designed to be run on the output from the Weighting.dms sample DMS file. See 7. Learning about weighting for more information.
ElementSpecifications.mrs
Contains examples of how to specify categories and other elements you want to include in a table, and how to display custom labels for elements. See Element list syntax for more information.
ExcelExport.mrs
Provides an example of exporting tables and charts to Microsoft Excel and setting up properties for the export. See Microsoft Excel tables export for more information. To run this sample, you need to have Microsoft Office 2007 or later installed.
FailoverDemo.mrs
Provides an example for populating the remaining batch tables when one or more tables fail. See Table population and failover for more information.
FilterOnAgeGroups.mrs
Demonstrates setting up tables that are filtered on each category of a categorical variable.
FormattedLabels.mrs
Demonstrates setting up HTML formatting in the variable and element labels and exporting them to HTML using the UseFormattedLabels HTML export property. See HTML tables export: Formatted labels for more information.
GridAndLoopSlices.mrs
Provides examples of creating tables using grid and loop slices. See Grid and loop slices for more information.
GridTables.mrs
Provides examples of creating grid tables from both a typical grid question and from a numeric loop. See Grid tables for more information.
HideRules.mrs
Provides examples of adding hide rules to tables to hide rows, columns, or cells based on the values. See Hiding rows and columns for more information.
HierarchicalData.mrs
Provides examples of creating tables for data in a hierarchical data set and populating the tables at different levels. See Understanding population levels and Setting the population level for more information.
HierarchicalFilters.mrs
Contains examples of how to use filters with hierarchical data. See Filtering hierarchical data for more information.
HTMLCharts.mrs
Creates some simple tables and exports them to HTML as charts. See Creating charts for more information. To run this sample, you need to have Microsoft Office 2007 or later installed.
HTMLExportOptions.mrs
Provides examples of setting up various options when exporting tables to HTML. See HTML tables export for more information. To run this sample, you need to have Microsoft Office 2007 or later installed.
IncludeInBase.mrs
Provides examples of excluding categories from the base calculation using the IncludeInBase property. For further information see Excluding Categories from the Base Element in Element properties.
JapaneseTables.mrs
Provides an example of selecting labels in Japanese and defining a custom Japanese label for the autobase elements. You need to have Japanese installed on your computer to be able to view the Japanese texts. See Working with languages for more information.
MoreOnConcatenatingAndNesting.mrs
Creates a number of tables that demonstrate complex concatenation and nesting of axes. See More on concatenation and nesting for more information.
MoreOnFilters.mrs
Provides examples of setting up and using table, global, and default filters. See More on filters for more information.
MSExcelFormatting.mrs
Provides examples for formatting Excel sheets from .mrs files. For example, the file provides examples for freezing panes and including auto-filters.
MyFirstFilter.mrs
Creates two simple tables of Age by Gender, both filtered to exclude respondents in the 11-16 age group. The first filter is created using the ContainsAny function and the second using an equivalent expression. See Defining your first filter for more information.
MyFirstFrequencyTable.mrs
Creates a simple frequency table and exports it to HTML. See Creating a frequency table and defining cell contents for more information.
MyFirstGridTable.mrs
Provides simple examples of creating grid tables. See Creating a grid table for more information.
MyFirstSortedTable.mrs
Provides simple examples of sorting tables on a row or column. See Introduction to sorting tables for more information.
MyFirstTable.mrs
Creates the table described in the first topic in the Tutorial. See Creating a simple table of Age by Gender for more information.
NetDifferenceTest.mrs
Creates tables with the net difference statistical test. For further information, see shared/Example of the net difference test.
NumericVariables.mrs
Shows how to create tables using numeric variables, by adding bands to group the values into categories, and using summary statistics. See Working with numeric variables for more information.
PairedPreferenceTest.mrs
Creates a paired preference test. See Paired preference test for more information.
PercentageOnElementsAsked.mrs
Uses the IsElementInVersions function to determine whether an element exists in a specific version of the metadata and calculate percentages based on numbers of respondents who were asked a question compared to the number who answered. See Changing the base to reflect the version for more information.
PowerPointExport.mrs
Provides an example of exporting to Microsoft PowerPoint and setting up properties for the export. See Microsoft PowerPoint tables export for more information. To run this sample, you need to have Microsoft Office 2007 or later installed.
ProductDifferenceTest.mrs
Splits a number of variables on the side axis into individual categories, creates a row for each combination of categories, and carries out a column proportions or column means test. See Example of the product difference test for more information.
ProfileTables.mrs
Contains examples of creating profile tables. See Working with profile tables for more information.
QuanceptTables.mrs
Provides an example of creating tables using data from Quancept qdi/drs files. For further information, see Loading other types of data and Using the flat (VDATA) view.
QuantumTables.mrs
Provides an example of creating tables using data from Quantum .dat files. For further information, see Loading other types of data.
QuanvertTables.mrs
Provides an example of creating tables using data from a Quanvert database. See Loading other types of data. Tables created include Examples of the column means test, and examples using the built-in base element (see Base element).
RDBTables.mrs
Demonstrates creating tables using case data collected using UNICOM Intelligence Interviewer - Server Admin and stored in an RDB database. It also provides an example of using the DataCollection.MetadataVersion system variable in a table, setting up a custom label for an axis, and defining properties for elements in the axis specification. To run this sample, you need access to a SQL Server installation on which the Short Drinks sample database has been restored and appropriate user access rights. See Loading other types of data, Working with versions, and Element properties.
ReusingAxes.mrs
Creates a reusable axis called MyBanner and then uses this axis in multiple tables. See Reusing axes for more information.
SavTables.mrs
Provides an example of creating tables using data from a .sav file. See Loading other types of data for more information.
SortedTables.mrs
Provides examples of sorting nested and concatenated tables, tables containing nets and other special elements, and grid tables. See Sorting tables for more information.
SpecialElements.mrs
Provides examples of using special elements in tables, including means based on numeric variables and on factors, total and subtotal elements, net elements, combined elements, derived elements and sum elements. Also includes examples of banding numeric and date variables and autocoding text variables, and other examples using expressions to define elements. See Special elements for more information.
StatisticalTests.mrs
Creates tables with chi-square and column proportions statistical tests. For further information, see Example of the chi-square test and Examples of the column proportions test.
SummaryStatisticTables.mrs
Shows how to create tables containing summary statistics of numeric variables (in this case, tables of means). See Creating summary statistic tables for more information.
SurveyCraftTables.mrs
Provides an example of creating tables using data from Surveycraft .qdt/vq files. See Loading other types of data for more information.
TabulateAllVariablesAtSpecifiedLevel.mrs
This sample sets up tables for all categorical and grid questions at a specified level. A message is written to a text file if the level is invalid for a particular variable.
TextExport.mrs
Provides an example of exporting tables to a .csv text file and setting up properties for the export. See Text tables export for more information.
TTestTests.mrs
Creates tables with T-test tests. For further information, see Example of the T-test test.
TukeyTest.mrs
Creates tables with Tukey tests. For further information, see Example of the Tukey test.
UnderstandingAxes.mrs
Illustrates the way in which the axis structure of complex tables is built up in the Table Object Model. See Understanding axes for more information.
WeightedTables.mrs
Creates two simple tables of Age by Gender, both. weighted using the Genbalance weighting variable. See Weighting tables for more information.
WordExport.mrs
Provides an example of exporting tables to Microsoft Word and setting up properties for the export. It also includes adding an image to the annotations. See Microsoft Word tables export for more information. To run this sample, you need to have Microsoft Office 2007 or later installed.
WorkingWithLabels.mrs
Provides an example of creating top line tables for all the simple categorical variables in the UNICOM Intelligence Interviewer - Paper routing that have a short name defined. See Working with labels for more information.
WorkingWithLanguages.mrs
Provides an example of creating tables in a language that is stored in the metadata but is not the default language and setting up element and variable labels in that language. See Working with languages for more information.
WorkingWithVersions.mrs
Provides an example of loading a specific version of the metadata and filtering the case data on the same version. To run this sample, you need access to a SQL Server installation on which the Short Drinks sample database has been restored and appropriate user access rights. See Working with versions for more information.
ZeroValues.mrs
Provides examples of using special characters to represent zero values, and of hiding rows and columns containing only zero values using hide rules or element specifications. See Handling zero values and setting hide rules for more information.
Requirements
UNICOM Intelligence Reporter
See also
Sample table scripts