• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
      • Introduction to Data Dictionary
      • Organization
      • Dictionary Concepts
        • General
        • Levels
        • Records
        • Items
        • Value Sets
        • Values
        • Relations
          • Relation Description
          • Relation Properties
      • Data Dictionary Application
      • How to ...
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • 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>

Relation Description

Relations provide a way of linking one multiple record or item to one or more multiple records or items. For example, suppose a questionnaire contains two record types, child records and mother records. Each child record contains a data item that gives the sequence number of the mother record of the child's mother. A relation can be defined which links child records to mother records so that when data items from a child record are processes, the corresponding mother record data items are available for processing. Relations work much like database joins.
Relations have one primary multiple record or item. Each instance of the primary element in a case is processed one at a time. A relation has one or more secondary records or items. The corresponding secondary elements are linked to the primary element during processing.
There are four types of linking that can defined by relations.
TypeDescription
Occurrence to OccurrenceCorresponding occurrences of the primary record or item and secondary record or item are linked, that is first occurrences are linked, second occurrences are linked and so on.
Item to OccurrenceThe value of an item on the primary record is a pointer to the occurrence of the secondary record.
Occurrence to ItemThe value of an item on the secondary record is a pointer to the occurrence of the primary record.
Item to ItemThe value of an item on the primary record is compared to the value of an item on the secondary record. If the values are equal, the records are linked.
Relations can be used in for statements in batch programs and in the Export Data tool.
See also: Relation Properties, Relation Statement