• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
      • Introduction to Tabulation
      • Parts of a Table
      • Parts of the Table Tree
      • Common Uses of Tabulation
      • Capabilities of Tabulation
      • Creating Tables
      • Formatting Tables
      • Creating Tables by Geographic Area
      • Printing Tables
      • Tabulation Preferences
      • Saving and Copying Table Data
      • Table Post Calculation
      • Run Production Tabulations
      • Advanced Table Topics
        • Using Subtables
        • Changing the Unit of Tabulation
        • Table Logic (tablogic)
        • Tabulations Using Relations
        • How To ...
          • Tabulate Items in Relations
      • Table Tips and Tricks
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Tabulate Items in Relations

 

A "relation" is created in the data dictionary. It links two record types through values on each record or occurrence number. If the two items have the same value then the records are linked, i.e., the items on the two record types are merged so all items "appear" to be on one big record.

 

A table or subtable using items from two record types linked through a relation is created in the same manner as any other table, i.e., drag and drop the items from each record. CSPro will automatically set the unit of tabulation to the relation between the two items. When the table is run, the tallies will be made from the linked records only.

 

Example:

In a Labor Force Survey, the record with labor force information is related to the record with person information through sequence numbers.

 

Here is the definition of the Link.

--------------------------------------------------------------------------------------------------------------

Relation Name Primary Linked by Secondary Linked by

--------------------------------------------------------------------------------------------------------------

LFS_LINK LFS LFS_NUMBER PERSON SERIAL_NUMBER

 

And how it is displayed in the data dictionary:

 

Data Dictionary Tree with a Relation

 

If "Age" value set is dropped for the Person record and the "Work last week?" value set is dropped from the LFS record then the following table is created.

 

Units Tallied in Tally Attributes (Table) Dialog Box

 

Since the LFS record is the primary link, the tallies will be done for each occurrence of the LFS record. (This assumes that every LFS record in the case can be linked to a Person record in the case and that no "universe" has been specified.)

 

Note: The "Unit Tallied" must be the relation defined in the data dictionary. CSPro will automatically set the default to the relation if such a relation exists.

 

See Also: Relation Description