For the complete documentation index, see llms.txt. This page is also available as Markdown.

OrderStarCustomer

Manipulating Metadata Properties ..

Workshop - OrdersStarCustomer

Metadata Properties

  1. Start Metadata Editor:

Windows (PowerShell):

Linux:

  1. Start the Pentaho Server (not required if using Pentaho Labs):

Windows (PowerShell):

Linux:

Follow the guide below to create your OrderStarCustomer domain:

Define a Domain & JDBC Connection

In the OrderStarCustomer workshop, the foundational step involves creating a new domain file and establishing a JDBC database connection that links the Pentaho Metadata Editor to the physical data source. The connection named "hsqldb:sampledata" is configured as a Hypersonic database type using Native JDBC access, pointing to localhost on port 9001 with the database name "sampledata" and credentials (pentaho_admin/password).

After successfully testing the connection, four physical tables are imported from the database into the metadata domain's physical layer: PRODUCTS (product dimension), ORDERFACT (fact table containing transactional order data), CUSTOMER_W_TER (customer dimension with territory information), and DIM_TIME (time dimension).

These imported tables form the physical foundation of the metadata model and can be verified in the Connections tree under hsqldb:sampledata, representing the raw database structures that will later be transformed into business-friendly abstractions through the Business Model and Business View layers.

  1. To define a new domain, select: File > New > Domain File from the main menu.

  2. Right-mouse click on Connections or: File > New > Connection:

Field
Parameter

Connection name

hsqldb:sampledata

Connection Type

Hypersonic

Access

Naitive (JDBC)

Host name

localhost

Database Name

sampledata

Port Number

9001

User Name

pentaho_admin

Password

password

  1. Click Test.

  2. Click OK to dismiss the Database Connection Test dialog, and then click OK to close the Database Connection dialog.

  3. Leave the Metadata Editor and the Import Tables dialog open.


Import Tables

The next step is to import table metadata from your data source into the physical layer and then add the table metadata to the abstract business layer.

  1. If the Import Tables dialog is not open, right-click hsqldb:sampledata and choose Import Tables.

  2. In the Import Tables dialog, press and hold the Ctrl key and use the mouse to select the following tables:

PRODUCTS

ORDERFACT

DIM_TIME

CUSTOMER_W_TER

The ORDERFACT table is the FACT table for the star schema.

  1. Click OK to import the table metadata.

  2. Expand Connections > hsqldb:sampledata and verify each of the tables appears in the physical layer.

Business Model

In the OrderStarCustomer workshop, the Business Model serves as the central container that connects physical database tables to business-friendly abstractions and defines the relationships that enable proper SQL generation. The model is created with the name "OrderStarCustomer" and assigned a system-generated unique ID (BV_MODEL_1) that Pentaho uses internally to reference the correct model when generating SQL statements.

It is linked to the hsqldb:sampledata database connection and contains a description identifying it as a "Business model for Steel Wheels star schema." Four business tables (PRODUCTS, ORDERFACT, CUSTOMER_W_TER, and DIM_TIME) are added by dragging them from the physical layer, exposing their inherited metadata properties for enrichment. Three N:1 (many-to-one) relationships are then defined with Inner joins to establish the star schema structure: ORDERFACT connects to CUSTOMER_W_TER via CUSTOMERNUMBER, to PRODUCTS via PRODUCTCODE, and to DIM_TIME via TIME_ID.

These relationships appear visually in the Graphical View and enable the metadata layer to automatically generate proper table joins when users create reports.

  1. Right-click Business Models and choose New Business Model.

  2. In the Business Model Properties dialog, in the General section, for Name, replace the existing value in the String column by typing: OrderStarCustomer.

  1. In the upper right corner of the dialog, for Connection, choose: hsqldb:sampledata.

  2. Click OK to close the ‘Business Model Properties’ dialog.

Business Model - OrderStarCustomer

Business Tables

Tables that represent the model. These expose the inherited BASE metatadata Properties that can be edited / enriched to ensure consistency for your business users.

  1. Expand Business Models > OrderStarCustomer.

  2. Drag the PRODUCTS table from Connections > hsqldb:sampledata to Business Models > Business Tables to add the table (and columns) to the abstract business layer.

The tables cannot be dragged into the ‘Business Tables’ view as a group. They must be added individually. When you receive the Business Model Properties dialog, note the table ‘ID,’ BT_PRODUCTS_PRODUCTS, and the ‘Physical Table’ name, PT_PRODUCTS.

  1. Click OK to dismiss the properties dialog. Using the Business Model Properties dialog, you can (optionally) remove columns from the tables before adding them to the business model.

  2. Repeat the previous steps to add:

ORDERFACT

DIM_TIME

CUSTOMERS_W_TER

  1. Save.

Relationships

Database table relationships define how data in one table connects to data in another table, establishing logical associations that reflect real-world business rules and enable efficient data retrieval through joins. Relationships are implemented using primary keys (unique identifiers in a table) and foreign keys (columns that reference primary keys in related tables), ensuring referential integrity and eliminating data redundancy.

The three fundamental relationship types are one-to-one (1:1), where each record in one table corresponds to exactly one record in another table; one-to-many (1:N or N:1), the most common type where a single record in a parent table can relate to multiple records in a child table (such as one customer having many orders); and many-to-many (N:M), where multiple records in one table can relate to multiple records in another table, typically implemented through an intermediary junction table.

These relationships form the backbone of relational database design, enabling complex queries across multiple tables while maintaining data consistency, reducing storage redundancy, and supporting business logic through enforced constraints that prevent orphaned records and maintain data quality across the entire database schema.

Relationships - OrdersStarCustomer

Follow the guide to define the Relationships:

  1. Expand Business Models > OrderStarCustomer (if necessary), right-click Relationships and choose New Relationship.

  2. In the Relationship Properties dialog, in From Table / Field, choose BT_ORDERFACT_ORDERFACT as the source table.

  3. In the field to the right of From Table / Field, choose source key value BC_ORDERFACT_CUSTOMERNUMBER.

This creates the relationship between the ORDERFACT and CUSTOMER_W_TER tables. The editor defines logical relationships based on a key value. A complex join (with multiple keys) can be specified, but a well-structured data warehouse should rarely use complex joins.

  1. In To Table / Field, choose BT_CUSTOMER_W_TER_ CUSTOMER_W_TER as the destination table.

  2. In the field to the right of To Table / Field, choose destination key value BC_CUSTOMER_W_TER_CUSTOMERNUMBER. You may also use Guess Matching Fields to try to automatically determine the relevant key values.

  3. For Relationship, choose N:1 (many to 1).

  4. For Join type, choose Inner. An inner join produces a result set when there is at least one row in each table that matches the join condition.

  5. Accept the remaining default options and click OK. A visual representation of the relationship appears in the Graphical View.

  1. Right-click Relationships and choose New Relationship.

  2. In the Relationship Properties dialog, in From Table / Field, choose BT_ORDERFACT_ORDERFACT as the source table.

  3. In the field to the right of From Table / Field, choose source key value BC_ORDERFACT_PRODUCTCODE. This creates the relationship between ORDERFACT and PRODUCTS.

  4. In To Table / Field, choose BT_PRODUCTS_PRODUCTS as the destination table.

  5. In the field to the right of To Table / Field, choose destination key value BC_PRODUCTS_PRODUCTCODE.

  6. For Relationship, choose N:1 (many to 1).

  7. For Join type, choose Inner.

  8. Accept the remaining default options and click OK. A visual representation of the relationships will appear in the Graphical View.

  1. Right-click Relationships, and choose: New Relationship.

  2. In the Relationship Properties dialog, in From Table / Field, choose BT_ORDERFACT_ORDERFACT as the source table.

  3. In the field to the right of From Table / Field, choose source key value BC_ORDERFACT_TIME_ID.

  4. In To Table / Field, choose BT_DIM_TIME_DIM_TIME as the destination table. This creates the relationship between ORDERFACT and DIM_TIME.

  5. In the field to the right of To Table / Field, choose destination key value BC_DIM_TIME_TIME_ID.

  6. For Relationship, choose N:1 (many to 1).

  7. For Join type, choose Inner.

  8. Accept the remaining default options and click OK. A visual representation of the relationships will appear in the Graphical View.

  9. Save the OrdersStarCustomer domain.

Properties

In the OrderStarCustomer workshop, Properties are the configurable attributes that transform technical database column names into business-friendly terms and control how data is processed and displayed to end users. After importing physical tables into the Business Model, developers systematically override the inherited Name properties for each column across all business tables (PRODUCTS, ORDERFACT, DIM_TIME, and CUSTOMER_W_TER).

This converts technical names like PRODUCTCODE and CUSTOMERNUMBER into readable labels like "Product Code" and "Customer Number" that business analysts can easily understand. Model Descriptor properties such as Data Type and Default Aggregation are also configured to control SQL generation behavior. For example, Order Date is set to Date type for proper formatting, and Price Sold is configured with Sum as the default aggregation plus optional aggregation methods.

These property configurations ensure that when users build reports, the metadata layer automatically applies correct data types, aggregation functions, and business terminology without requiring users to understand the underlying database structure or write SQL code.

  1. Right-click PRODUCTS and choose: Edit.

  2. In the Business Table Properties dialog, in the Subject pane, select: PRODUCTCODE.

  3. In the Available pane, click: General > Name.

  4. In the Settings section, click: the Override button.

  5. In the String column, type: Product Code.

  6. In the Subject pane, select: PRODUCTNAME.

  7. Repeat the previous steps to change the Name string to: Product Name.

  8. Repeat the previous steps to change the names of the remaining columns to the following:

Product Line

Product Scale

Product Vendor

Product Description

Quantity In Stock

Buy Price - There is no need to edit the MSRP name.

  1. Click OK and save your work.

  1. Expand Business Models > OrderStarCustomer > Business Tables.

  2. In the Business Tables view, right-click ORDERFACT and choose: Edit.

  3. In the Settings section, click: the Override button.

  4. Repeat the previous steps to change these column names to the following:

Order Number

Product Code

Quantity Ordered

Order Line Number

Total Price

Order Date

Required Date

Shipped Date

Status

Comments

Customer Number

  1. Click OK and save your work.

  1. In the Business Tables view, right-click DIM_TIME and choose: Edit.

  2. In the Subject pane, select: TIME ID.

  3. In the Available pane, click: General > Name, click Override, and change the String value to: Time ID.

  4. Repeat the previous steps to change the remaining column names to the following:

Year ID

Month Name

Month Description

Qtr Name

Qtr Description

  1. Click OK and save your work.

  1. In the Business Tables view, right-click CUSTOMER_W_TER and choose: Edit.

  2. In the Business Table Properties dialog, in the Subject pane, click: CUSTOMERNUMBER.

  3. In the Available pane, click General > Name, click: Override icon, and change the String column value to: Customer Number.

  4. Repeat the previous steps to change the remaining columns to the following:

Customer Name

Contact Last Name

Contact First Name

Phone

Addressline1

Addressline2

City

State

Postal Code

Country

Employee Number

Credit Limit

Territory

Territory Colour

  1. Click OK and save your work.

Calculated Values & Formulas

Formulas serve four critical functions in Pentaho metadata: they define constraints in Metadata Queries to filter data subsets, enable physical table columns to combine multiple database columns or perform complex aggregate calculations, support sophisticated multi-key joins and logic in business model relationships, and enforce row-level security.

Pentaho uses JFreeReport's libFormula package to interpret formulas in OpenFormula syntax, then automatically converts them into database-native SQL, providing flexibility and power across your metadata layer.

Aggregation

Setting predefined values.

  1. In the Subject pane, select: PRICEEACH from ORDERSFACT.

  2. In the Available pane, click General > Name, click: Override, and change the String value to: Price Sold

  3. In the Available pane, in the Model Descriptors section, click: Default Aggregation.

  4. Click the Override icon.

After clicking Override, the Settings pane may jump to the top of the page.

Click Default Aggregation again or scroll down to the section in the Settings pane.

  1. For Aggregation Type, choose: Sum.

  2. In the Available pane, click: Optional Aggregations.

  3. Select all the following options in the Aggregation List using the Ctrl key:

Average

Minimum

Maximum

  1. Click OK and save your work.

Data Type

Enables you to apply masks, defining and formatting the object's data type.

  1. In the Subject pane, select: Order Date.

  2. In the Available pane, click: Model Descriptors > Data Type,

  3. Click: Override, and change the Data Type value to: Date.

  1. Click OK and save your work.

Formulas

After configuring the display names for your table columns, the next step is to add any formulas you wish to have calculated at the metadata level. In this exercise, you use formulas to define physical table columns that combine values from other columns.

  1. Expand Connections > hsqldb:sampledata.

  2. Right-click: ORDERFACT > Edit.

  3. In the Physical Table Properties dialog, above the Subject pane, click: Add New Column.

  4. In the New Column dialog, type: PC_TOTAL and click OK.

  5. In the Subject pane, click: Total, and

  6. In the Available pane, click: Default Aggregation.

  7. For Aggregation Type, choose: Sum.

  8. Click: Optional Aggregations.

  9. In the Aggregation List, use the Ctrl key to select the following options:

Average

Minimum

Maximum

  1. In the Available pane, click: Model Descriptors > Data Type.

  2. From the Data Type drop-down list, select: Numeric.

  3. In the Available pane, click: Calculation > Formula.

  4. In the Formula section, in the Value field, type:

  1. Check Is the formula exact?

  2. Click OK and save your work.

Total

You can also use Formulas to calculate various Totals.

  1. Expand Business Models > OrdersStarCustomer > Business Tables (if necessary).

  2. Right-click ORDERFACT and choose: Edit.

  3. In the Business Table Properties dialog, above the Subject pane, click: Add New Column button.

  4. In the Add New Column dialog, click: Total and click: OK.

  5. Click OK and save your work.

Contact

An example of how to concatinate Business Columns in MQL - Metadata Query Language.

  1. Expand Connections > hsqldb:sampledata.

  2. Right-click CUSTOMER_W_TER and choose Edit.

  3. In the Physical Table Properties dialog, above the Subject pane, click the Add New Column.

  4. In the New Column dialog, type PC_CONTACT and click OK.

  5. In the Subject pane, select Contact and in the Available pane, click General > Name.

  6. In the String column, type Contact Name.

  7. Optional: In the Description section, in the String column type: Full Name of Contact Person.

  8. In the Available pane, click Calculation > Formula.

  9. In the Formula section, in the Value field, type:

  1. Check Is the formula exact?

  2. Expand Business Models > OrderStarMetadata > Business Tables (if necessary).

  3. Right-click CUSTOMER_W_TER and choose Edit.

  4. In the Business Table Properties dialog, above the Subject pane, click the Add New Column button.

  5. In the Add New Column dialog, click Contact Name and click OK.

  6. Click OK and save your work.

Business Views

In the OrderStarCustomer workshop, Business Views are created as the final presentation layer by organizing business table columns into four logical categories—CT_ORDERS (Orders), CT_CUSTOMERS (Customers), CT_PRODUCTS (Products), and CT_TIME (Time)—that business users can easily understand and navigate.

Using the "Manage Categories" dialog, developers selectively add relevant columns from the underlying business tables (ORDERFACT, CUSTOMER_W_TER, PRODUCTS, and DIM_TIME) into their appropriate categories, such as placing Order Number, Order Date, Status, and the calculated Total field into the Orders category.

This categorization transforms the technical star schema structure into intuitive, business-friendly groupings that enable analysts to build reports by simply selecting fields from familiar categories without understanding the underlying table relationships or SQL joins.

Business Views - OrdersStarCustomer

Follow the guide to apply the Business Views:

Orders Category

The CT_ORDERS category is a business view within the OrderStarCustomer metadata model that organizes order-related data from the ORDERFACT table into a business-friendly structure.

This category, named "Orders" for end users, consolidates nine key order management columns including Order Number, Order Date, Required Date, Shipped Date, Status, and Comments for tracking order fulfillment, along with transactional metrics such as Price Sold, Quantity Ordered, and Total (a calculated field multiplying quantity by price).

  1. Expand Business Models > OrdersStarCustomer (if necessary), right-click Business View and choose New Category.

  2. In the Business Category Properties dialog, in the ID field, type: CT_ORDERS.

CT_ORDERS
  1. In the General section, for Name, type Orders in the String column.

Optional: In the Description section, for the en_US locale, type the following description in the String column: This category contains information about orders including order number, order date, required date, shipping status, etc.

  1. Click OK (later .. you will configure the security).

  2. Expand Business Models > OrderStarCustomer > Business View (if necessary).

  3. Right-click Business View > Orders and choose Manage Categories.

  4. In the Manage Categories dialog, in the Available Business Tables pane, expand ORDERFACT.

  5. In the Available Business Tables pane, select the Order Number column, in the Business View Categories pane, select Orders, and click the Add button.

Items in both Available Business Tables and Business View Categories must be selected before clicking Add.

  1. Repeat the previous steps to add the following additional columns from the ORDERFACT table:

Quantity Ordered Price Sold Total Price Order Date Required Date Shipped Date Status Comments Total

CT_CUSTOMERS

The CT_CUSTOMERS category is a business view within the OrderStarCustomer metadata model that consolidates customer-related information from the CUSTOMER_W_TER table into a user-friendly structure for business reporting and analysis.

This category, labeled "Customers" for end users, contains thirteen comprehensive customer attributes including Customer Number as the key identifier, Customer Name, and Contact Name (a calculated formula field that concatenates contact first and last names with a comma separator). The category also includes complete address details across multiple fields (Address Line 1, Address Line 2, City, State, Postal Code, Country), geographic sales Territory assignment, Sales Rep Employee Number for account ownership tracking, Credit Limit for financial management, and Phone for communication.

  1. To the right of the Business View Categories pane, click the Add New Category button.

  2. In the Business Category Properties dialog, in the ID field, type: CT_CUSTOMERS.

  3. In the General section, for Name, in the String column, type Customers.

Optional: In the Description section, type a description in the String column such as: This category contains information about customers.

  1. Click OK.

  2. In the Manage Categories dialog, in the Available Business Tables pane, expand CUSTOMER_W_TER.

  3. In the Available Business Tables pane, select the Customer Number column, in the Business View Categories pane, select Customers, and click the Add button.

  4. Repeat the previous steps to add these additional columns to the Customers category:

Customer Name

Phone

Addressline1 & Addressline2

City

State

Postal Code

Country

Employee Number

Credit Limit

Territory

Contact Name

CT_PRODUCTS

The CT_PRODUCTS category is a business view within the OrderStarCustomer metadata model that organizes product dimension data from the PRODUCTS table into a comprehensive, business-friendly structure for product analysis and inventory management.

This category, named "Products" for end users, encompasses nine key product attributes including Product Code as the unique identifier, Product Name for item identification, and descriptive classification fields such as Product Line (for product family groupings), Product Scale (indicating model or size specifications), and Product Vendor (identifying suppliers or manufacturers).

The category also includes Product Description for detailed item information, inventory management metrics with Quantity In Stock for availability tracking, and pricing data through Buy Price (wholesale or cost basis) and MSRP (Manufacturer's Suggested Retail Price) for margin analysis and pricing strategy. By consolidating these product dimension attributes into a single category, the business view enables analysts to perform product performance analysis, inventory optimization, vendor evaluation, pricing strategy assessment, and product portfolio management without requiring technical knowledge of the underlying database schema.

  1. In the Manage Categories dialog, click the Add New Category button.

  2. In the Business Category Properties dialog, in the ID field, type: CT_PRODUCTS.

  3. In the Settings section, for Name, in the String column, type: Products.

Optional: In the Description section, in the String column, type a description such as: This category contains information about products.

  1. Click OK.

  2. When you are returned to the Manage Categories dialog, in the Available Business Tables pane, expand Products and click the Product Code column.

  3. In the Business View Categories pane, click Products and click the Add button.

  4. Repeat the previous steps to add these additional columns to the Products category:

Product Name

Product Line

Product Scale

Product Vendor

Product Description

Buy Price

MSRP

CT_TIME

The CT_TIME category is a business view within the OrderStarCustomer metadata model that provides comprehensive temporal analysis capabilities by organizing time dimension attributes from the DIM_TIME table into a hierarchical, business-friendly structure for date-based reporting and trend analysis.

This category, named "Time" for end users, includes seven essential time attributes starting with Time ID as the unique temporal identifier, followed by The Full Date for complete date reference, and granular time components including Day of Week (enabling weekday pattern analysis), Day of Month (supporting daily cycle analysis), Month (facilitating monthly comparisons), Year (enabling annual trending), and Quarter (supporting quarterly business cycle analysis).

By structuring these temporal attributes into a dedicated category, the business view enables analysts to perform sophisticated time-series analysis, seasonal trend identification, period-over-period comparisons, fiscal reporting, and date-driven business intelligence without requiring knowledge of the underlying time dimension table structure or complex date manipulation SQL, supporting common business scenarios such as year-over-year growth analysis, quarterly performance reviews, and day-of-week sales patterns.

  1. In the Manage Categories dialog, click the Add New Category button.

  2. In the Business Category Properties dialog, in the ID field, type: CT_TIME.

  3. In the Settings section, for Name, for String, type: Time.

Optional: In the Description section, in the String column, type a description such as: This category contains details about order dates, including quarters, years, and months.

  1. Click OK.

  2. When you are returned to the Manage Categories dialog, in the Available Business Tables pane, expand DIM_TIME and choose the Time ID column.

  3. In the Business View Categories pane, select Time and click the Add button.

  4. Repeat the previous steps to add the following additional columns to the Time category:

Year ID

Month Name

Month Description

Qtr Name

Qtr Description

  1. Close the Manage Categories dialog. You will publish the metadata domain to the server after you complete the next exercise on metadata concepts.

  2. Save your work. Leave Metadata Editor open.

Last updated

Was this helpful?