DOMAIN
A domain is a segment, or a set of records chosen for a specific purpose. A database is made up of records, and these records internally form groups that have similar features. For example, a company’s customers can be female or male, but not both. For example, to specify the target audience for a marketing campaign, you can combine segments, such as females at age between 25 and 35, from Barcelona, and average purchasing power.
A Domain instruction can be defined as a simple query, or as a more complex set of segments. A Domain instruction must have the following syntax:
Syntax
DOMAIN [Target table] [Target column] [Domain]
Parameters
Target table
Defines a target table.
Target column
Defines a target column. Do not use the following characters:
/ \ º ª - accents, dieresis, ?, !, *, @, #, &, $, o, ñ
Domain
Defines a domain name. Specify a query that defines a domain, using any of the tools described in Table 5‑3.
Table 5‑3 Domain definition features
Icon
Tool
Description
Simple query
Defines a simple query. Allows you to create a query, by selecting database columns, and operations from the
database.
Block
Defines a new block of segments. A segment can contain multiple queries. A domain can be build of multiple blocks. The blocks act as parenthesis and define the order of execution.
Select all
Select all records from a table.
Resolution
Changes the resolution of the whole domain or of a set of values entered in a block. For example, if you make a domain of records of people who are women and managers, and you want to see the households where the people who meet these conditions live, you can use this option to verify the results in a dimension other than the source of the values.
Inversion
Inverts the selected value or values. For example, if you use Invert on a domain that contains the records of people that are women and managers, you get the records of people who are not women and not managers.
Discrete values
Selects the values that create the domain. Select a value from a column in the database.
Sorting
Sorts the values in a column in ascending or descending order.
Sample selection
Creates a sample of number of records.
How to create a domain
1 In the Transform tab, choose New. Then choose DOMAIN in the list of transformation instructions. The Domain screen appears.
2 In the Table fields, select the database, and the table from the drop-down list, or select the table in the Repository’s structure panel and drag it to the column box.
3 In the Column field, type the new column name, as shown in Figure 5‑14.
Figure 5‑14 Creating a domain
4 Click on the Domain field to open the Domain definition screen.
5 Create a new query, as shown in Figure 5‑15.
Figure 5‑15 Defining a domain
1 In Name, type the name of the domain.
2 Drag New query from the toolbar over the New block icon, located on the left side of the Name field label, as shown in Figure 5‑15.
3 In New query fields, select a database, a table, and a column, or drag a column from Repository. Then select the operator, for example =, from the drop-down list.
4 In the New query fields, type a value, for example US.
5 Drag the New query icon over the New block icon to add a second condition.
6 Select the operator between the two conditions. If you want to get the records for all women in US, you must select AND.
7 Fill in all the Query fields for the second condition.
8 Select operator, and type a value, for example “F” (for female).
6 Click on the OK button to confirm your definitions and return to the main Transform screen. The new domain instruction appears in Main file, as shown in Figure 5‑16.
Figure 5‑16 Creating a Domain instruction
7 Choose Save at the top of the Project screen to save the project.
8 Verify that the new column was created.
1 Choose Data Management.
2 Choose Explorer.
3 Expand the list of tables and columns in the Repository tree. The new Domain column, (in this example FemalesUS), appears in the list. Select the column and choose View details to examine the new column properties and values, as shown in Figure 5‑17.
Figure 5‑17 Validating the new domain column