Edit the Data Set

The data set consists of the database tables the segment is referencing.

The Contacts (contacts) table is automatically added to the data set when you create a segment. When you add fields from different database tables as filters or add more than one table to the data set, the tables that contain the fields are automatically joined together. This lets you use data from tables related to contacts; for example, incidents.

Tables can be joined using two methods, or join types:

  • Inner join—Inner joins select records from the joined tables on the condition that the value in the specified column of the primary table is equal to the value in the specified column of the secondary table. For example, if the Incidents table is joined to the Contacts table with an inner join, contacts without an associated incident are not included.

  • Outer join—Outer joins select rows from two tables regardless of whether the specified columns contain corresponding values. An outer join returns all rows from the primary table and any rows from the secondary table where the value in the specified column of the primary table is equal to the value in the specified column of the secondary table. For example, if the Incidents table is joined to the Contacts table with an outer join, contacts without an associated incident are included.

Note: Tables are automatically added to the data set when you select columns to filter by in the segment.
  1. Click Edit Data Set in the Advanced Options section.
    The Edit Data Set window opens, listing the tables in your segment and their relationships.
  2. To add another table, right-click the table you want to join to, select Join To, and select the table and columns you want to join (for example, Incidents >contact.c_id=incidents.c_id). Repeat this step for each table you want to add.
  3. To edit table join information, click the table that is joined to the parent table.
    This image shows the table that is joined to the parent table and the available join options which are defined in the Edit Data Set window table.


    This figure shows the Edit Data Set window. Available options are described in the preceding text, and in the table that follows.
    1. Enter field information.

      Edit Data Set Window

      Field Description

      Table

      This field displays the database name of the table you have selected.

      Delete Table

      Click Delete Table to remove the table you have selected from the segment. If the table acts as a parent to other tables in the segment, the child tables are also removed.

      Alias

      This field displays the alias name of the table you have selected. The alias allows for multiple instances of the same database table to the same segment. For example, the first instance of the Contacts (contacts) table would have an alias of “contacts,” and the second instance would have an alias of “contacts2” to distinguish it from the first instance.

      Join To

      This field displays the table that the selected table is joined to.

      Join Condition

      If more than one field relationship is available to join the tables, click this drop-down list to select the fields on which to join.

      If only one field relationship is available, the menu displays only that option.

      Join Type

      Select the Inner option to use an inner join and the Outer option to use an outer join.

      Tip: To change the join type, you can also right-click the joined table in the Data Set tree and select Toggle Join Type.

      Join Filters

      If you select the Outer join type, the option to add join filters becomes available.

  4. Click OK.