My first subset

This examples are based on small database tables, their primary/foreign key relationships displayed in Subset definition explanation and rules page.

To create new Subset definition select Create subset definition button. Enter subset Name, select Data source and Environment. After confirming Design subset definition screen will be open.

Table of contents
Example 1.
Example 2.
Example 3.

Example 1.

Let's create a subset base where all employees are from the 'IT' department. Required tables for this subset are: DEPARTMENTS and EMPLOYEE. Drag table DEPARTMENTS from Toolbox to empty Design surface as root table. Right click with mouse on DEPARTMENTS table and select Subset table details from drop down menu. Set Local custom filter on DEPARTMENTS to DEPARTMENT_NAME='IT' and Confirm criteria. Icon for Local custom criteria will appear. Drag now table EMPLOYEES as a child of table DEPARTMENTS. Subset relationship pop-up window will be open where the relationship between Department ID should be chosen. Run the subset.

EXPECTED RESULT:

  • The EMPLOYEES table contains: All employees working in the "IT" department (department_id = 60) and their managers working in department "Executive" (department_id=90)
  • The DEPARTMENTS table contains of "IT" and "Executive" Department name.
  • The JOBS table contains of jobe related in "IT" and "Executive" Department name.
  • REGIONS, COUNTRIES and LOCATION tables will alse be included in subset as they are parent table and implicit relationship.

Example 2.

In second example let's create a subset database using replacement strategy - random value. On the Design surface create relation that's using LOCATION table as parent and COUNTRIES table as a child. Set filter on COUNTRIES table: COUNTRY_ID='IT'. Check inside of a relation connector and set Replacement strategy to Random value. Run the subset.

EXPECTED RESULT:

  • Only Italy is inserted inside of the COUNTRY table and the LOCATION table data is filled with all the COUNTRY_ID="IT". There will be only one REGION, which is "Europe", and only one COUNTRY, which is "Italy"

Example 3.

Subset tables REGIONS, COUNTRIES where COUNTRY_ID = 'US', DEPARTMENTS and EMPLOYEES. Add REGIONS to an empty subset and COUNTRIES as the child of REGIONS. Set filter on COUNTRIES table: COUNTRY_ID = 'US'. Add LOCATIONS as the child of COUNTRIES, add DEPARTMENTS as the child of LOCATIONS and add EMPLOYEES as the child of DEPARTMENTS. Run the subset.

EXPECTED RESULT: Subset database will have:

  • All Regions
  • Only one country (US)
  • Every location that is in US
  • All the departments located in the US
  • All the employees located in the US
  • Every employee that is manager to managers (with recursion)
  • Every selected employee's job