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

Data Model

Creating a model from various Data Sources ..

Workshop - Data Model

Data Source Wizard

When you first open the model editor, the centre pane of the dialog box displays the active model. This model is organized into categories and fields that represent the tables and columns in your data.

  • Creating a data source from a CSV file treats all columns as if they are in a single table, with no limitations on where measures come from or which fields can be grouped in a hierarchy.

  • Creating a data source from a database table for Reporting and Analysis requires you to specify a fact table. Only numeric columns from the fact table can be used as measures. Also, all levels in a single hierarchy must come from the same dimension table.

  • If you add or edit annotations on the data model in Analyzer, these annotations will not be visible when viewing the model in the Data Source Wizard. For example, if you add a calculated measure to the model in Analyzer, it will not display in the list of measures when viewing the model in DSW. Saving the model in DSW will overwrite any annotations which were added to the model in Analyzer.


Launch the Data Source Wizard

  1. Log into the Pentaho User Console:

User: Admin

Password: password

  1. Click Create New > Data Source or access from Manage Data Sources.

New Data Source

Select the model Data Source:

CSV File

Model from CSV file
  1. Download the Checkbook.csv file:

  1. Enter Data Source Name: Checkbook

Provide a descriptive name (avoid special characters: / \ : * ? " < > |)

  1. Select CSV File as Source Type.

  2. Click Import and browse to select your CSV file.

DSW - Import Checkbook_data.csv
  1. Configure the following CSV properties:

Property
Value

Data Source Name

Checkbook

Source Type

CSV File

File

/Downloads/Checkbook_data.csv

Encoding

ISO-8859-1

Delimiter

Comma

Enclosure

Double Quote

DSW - Configure Data Source
  1. Preview and Verify.

  2. Click Next to Continue.

The Staging Settings screen displays a list of columns from your CSV source file. All columns are enabled.

DSW - Staging
  1. Edit the following properties:

Name
Type
Source Format
Length
Precision

Date

STRING

15

0

Description

STRING

50

0

Category Desc

STRING

50

0

Category

STRING

5

0

Amount

NUMERIC

#,##0.00

10

2

  1. Click: Show File Contents.

File Preview
  1. Click Finish.

  2. Choose Model Option: Customize model now

Keep default model - Uses the data source as-is

Customize model now - Opens Data Source Model Editor for refinement


Select a reporting option:

Configure Model for Interactive & Analyzer reports

Interactive Reporting

Notice that the Wizard puts all the columns in one category. You can use the toolbar buttons to easily create additional categories and move the columns up and down to organize the columns into categories.

  1. On the Reporting tab, click the Check book category.

  2. In the Properties pane, click in the Category Name field.

  3. Rename: Checkbook Category.

DSW - Edit Display Name
  1. Format the Amount: #.#

  1. Click OK.


  1. From the User Console Home Perspective, click Create New > Interactive Report.

  2. In the Select Data Source window, click Checkbook, and then click OK.

Data Source - Checkbook
  1. On the Data tab, notice the Checkbook Category name.

Checkbook Report

If this is the first time you are using Interactive Reporting, you may need to click the Get Started button, and then click to Hide Tips.

  1. Add Category Desc, on the Data tab, double-click Category Desc.

  2. Add Date, on the Data tab, double-click Date.

  3. Add Amount, on the Data tab, double-click Amount.

Analyzer

  1. Edit the Checkbook model in the Data Source Wizard - From the Cog wheel drop-down menu option, select: Edit.

Edit Checkbook model
  1. Expand the Measures Dimensions.

Examine Analysis model

Notice that the metric 'Amount' is defined as a Measure & Dimension. Also each Dimension has a Hierarchy & a Level. Let's tidy up the model ..

  1. Delete the Amount Dimension - its a metric..! Click on the X in the top toolbar.

Remove Amount Dimension
  1. Drag &drop the Category Desc Level to below the Category Level.

Move Category Desc Level
  1. Delete the redundant Category Desc Dimension.

Delete the Category Desc Dimension

Notice: the warning triangle.

  1. Flip the Measures to below the Dimensions.

Flip Measures & Dimensions
  1. Click: OK


  1. From the User Console Home Perspective, click Create New > Analyzer.

  2. In the Select Data Source window, click Checkbook, and then click OK.

Checkbook Data Source
  1. Add the following Levels and Measure to define the Analyzer report.

Spreadsheet of Expenses..!

The following tasks refine your relational and multidimensional data models with the Data Source Model Editor:

  • Assign Geographic Properties

  • Assign Time Dimension Properties

  • Use Ordinal Columns

  • Properties of Time Dimension Levels

Database Table

When you create a Database Table data source, you are presented with two options: Reporting Only or Reporting and Analysis. The choice you make depends on the structure of the database tables you are accessing and the User Console tools being used.

Before creating the data source, let's understand the database structure. This is a classic star schema with one fact table and three dimension tables.

Table
Purpose
Primary Key

FACT

Stores transactional sales data with numeric measures

Prerequisites:

  • Database connection named 'hsqldb_sampledata' is configured and working

  • You have SELECT permissions on all four tables

  • Foreign key relationships exist in the database (or you'll create joins manually)

  • Tables contain sample data for testing


Complete the following steps to define your Sales_Analysis model and Data Source:

Data Source

  1. Enter Data Source Name: Sales_Analysis

  2. Select Database Table as Source Type.

Provide a descriptive name (avoid special characters: / \ : * ? " < > |)

Configure Sales_Analysis
  1. Select: hsqldb_sampledata from the list of available connections.

  2. Select: Reporting and Analysis (Requires a Star Schema)

  3. Click: Next

Add Tables

  1. Click the Schema dropdown menu

  2. Select your schema: PUBLIC (e.g., 'sales_schema' or 'public' depending on your database)

  3. Hold down the Ctrl key and select the following tables:

Add Tables
  1. Add the Tables an set the Fact Table.

Set Fact Table
  1. Click: Next.

Joins

Joins connect the Fact table to Dimension tables.

  1. Define the following Joins:

Left Table
Key Field
Right Table
Key Field

ORDERFACT

TIME_ID

DIM_TIME

TIME_ID

ORDERFACT

CUSTOMERNUMBER

CUSTOMER_W_TER

CUSTOMERNUMBER

ORDERFACT

ORDERNUMBER

ORDERS

ORDERNUMBER

ORDERFACT

PRODUCTCODE

PRODUCT

PRODUCTCODE

Joins
  1. Click: Finish.

Measures

Measures are the numeric values you want to analyze. They come from the Fact table and can be aggregated (summed, averaged, counted).

  1. Expand the Measures category.

  2. Delete the following dimensions:

  • CUSTOMERNUMBER

  • MONTH ID

  • ORDERLINENUMBER

  • ORDERNUMBER

  • QTR ID

  • YEAR ID

Remove unwanted Dimensions
  1. Format the remaining Measures:

Measure
Display Name
Default Aggregation
Format

PRICEEACH

Unit Price

Average

0.00

QUANTITYORDERED

Quantity Ordered

DISTINCT_COUNT

#

TOTALPRICE

Total Sales

SUM

0.00

Dimensions

Follow the steps outlined below to configure the Dimensions in your Model:

MARKETS

  1. Highlight & expand the Geography Dimension.

  2. Rename the Dimension: MARKETS.

  3. Add a Hierarchy: Markets.

Markets Hierarchy

Drill-down on Markets

Expand the Markets Hierarchy and follow the steps below to configure the Levels - delete POSTALCODE:

  1. Highlight the TERRITORY Level & configure with the following Properties.

Level - Territory
  • Click on the pencil icon to select TERRITORY Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Geography Type: Territory

  1. Highlight the COUNTRY Level & configure with the following Properties.

Level - Country
  • Click on the pencil icon to select COUNTRY Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Geography Type: Country

  1. Highlight the STATE Level & configure with the following Properties.

Level - State
  • Click on the pencil icon to select STATE Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Geography Type: State

  1. Highlight the CITY Level & configure with the following Properties.

Level - City
  • Click on the pencil icon to select CITY Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Do not check: Contains only unique members

  • Geography Type: City

CUSTOMERS

  1. Highlight & expand the CUSTOMER W TER Dimension.

CUSTOMER W TER
  1. It will be easier to start with a 'clean' dimension, delete everything..!

  2. Rename the CUSTOMER W TER Dimension: CUSTOMER.

Rename Dimension
  1. Add a Hierarchy & enter: Customer.

Hierarchy - Customer
  1. Highlight Customer Hierarchy & add Level: Customer Name.

Level - Customer Name
  1. Click: OK.

  2. Configure the Customer Name properties as illustrated below:

Customer Name Properties
  • Click on the pencil icon to select CUSTOMERNAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Do not Check: Contains only unique members


Customer Name - Members

Follow the steps below to add the Customer Name members:

  1. Highlight the Customer Name Level > Add Member Property: Customer Number.

Member - Customer Number
  1. Click: OK.

  2. Configure the Customer Number properties as illustrated below:

Customer Number Properties
  • Click on the pencil icon to select CUSTOMERNUMBER Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Enter a description

  1. Highlight the Customer Name Level > Add Member Property: Contact First Name.

Member - Contact First Name
  1. Click: OK.

  2. Configure the Contact First Name properties as illustrated below:

Contact First Name Properties
  • Click on the pencil icon to select CONTACTFIRSTNAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Enter a description

  1. Highlight the Customer Name Level > Add Member Property: Contact Last Name.

Member - Contact Last Name
  1. Click: OK.

  2. Configure the Contact Last Name properties as illustrated below:

Contact Last Name Properties
  • Click on the pencil icon to select CONTACTLASTNAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Enter a description

  1. Highlight the Customer Name Level > Add Member Property: Phone Number.

Member - Phone Number
  1. Click: OK.

  2. Configure the Phone Number properties as illustrated below:

Phone Properties
  • Click on the pencil icon to select PHONE Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Enter a description

PRODUCTS

  1. Highlight & expand the DIM TIME Dimension.

  2. Again It will be easier to start with a 'clean' dimension, delete everything..!

  3. Add a Hierarchy & enter: Products


Follow the steps below to configure the Products Levels:

  1. Under the Products Hierarchy > Add a Level: Product Line

Level - Product Line
  1. Click: OK.

  2. Configure the Product Line properties as illustrated below:

Product Line Properties
  • Click on the pencil icon to select PRODUCTLINE Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  1. Under the Products Hierarchy > Add a Level: Product Name

Level - Product Name
  1. Click: OK.

  2. Configure the Product Name properties as illustrated below:

Product Name Properties
  • Click on the pencil icon to select PRODUCTNAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

ORDERS

  1. Highlight & expand the Geography Dimension.

  2. Add a Hierarchy: Orders.

Markets Hierarchy

Drill-down on Markets

Expand the Markets Hierarchy and follow the steps below to configure the Levels - delete POSTALCODE:

TIME

Typically, you might sort your data by year or month. However, by designating a time dimension in the Data Source Model Editor, you can filter on a variety of date ranges and relative date options, such as previous periods, before [a user-defined period], after [a user-defined period], current period, or next period.

Analyzer supports many types of relative date filters. In order to apply them to a level of a time hierarchy, you need to define the time-specific properties for that level. This is because each data warehouse implementation may have a different date format and set of time hierarchy levels.

  1. Highlight & expand the DIM TIME Dimension.

  2. It will be easier to start with a 'clean' dimension, delete everything..!

  3. Add a Hierarchy & enter: Time


Follow the steps below to configure the Time Levels:

  1. Under the Time Hierarchy > Add a Level: Years

Level - Years
  1. Click: OK.

  2. Configure the Year properties as illustrated below - refer to Time Dimension Properties:

Year Properties
  • Click on the pencil icon to select YEAR ID Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Time Level Type: Years

  • Format: yyyy

  1. Under the Time Hierarchy > Add a Level: Quarters

  2. Configure the Quarters properties as illustrated below - refer to Time Dimension Properties:

Quarters Properties
  • Click on the pencil icon to select QTR NAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Time Level Type: Quarters

  • Format: Q

  1. Under the Time Hierarchy > Add a Level: Months

  2. Configure the Months properties as illustrated below - refer to Time Dimension Properties:

  • Click on the pencil icon to select MONTH NAME Source Column. Scroll down to the bottom of the list and Select: OK to add the column.

  • Check: Contains only unique members

  • Time Level Type: Months

  • Format: M


Time Dimension Properties

The Data Source Model Editor has two key settings for configuring time dimensions:

Time Level Type

This setting specifies what type of date increment a level represents (Years, Quarters, Months, Days, etc.). Analyzer uses this information to enable time-period functions like "previous quarter" or "year to date."

Source Column Format

This describes how your data is actually formatted in the database. It tells Analyzer how to read and interpret the time values. Important: This setting does NOT change how data displays—it only describes the existing format so Analyzer can filter correctly.

These settings enable Analyzer to properly filter and analyze time-based data.

Common Format Patterns

Time Increment
Format Codes
Examples Values

Years

yy

yyyy

25

2025

Quarters

Q

QQ

QQQ

1

01

Q1

Months

M

MM

MMM

3

03

Mar

Weeks

w

ww

W

5

05

Days

d

dd

7

07

Hours

H

HH

k

kk

Minutes

m

mm

5

05

Seconds

s

ss

8

08

Quarter Format Examples

Quarters can be stored in different ways. Here's how to configure the Source Column Format for each:

Data in Database
Source Column Format
Explanation

1, 2, 3, 4

Q

Simple numeric quarter

Q1, Q2, Q3, Q4

'Q'Q

'Q' is literal text, Q is the number

2001-Q1, 2001-Q2

yyyy-'Q'Q

Year, - literal Q, quarter number

Custom Formats

If the dropdown options don't match your data format, you can type directly into the Source Column Format field. Your format must follow the ICU Simple Date Format specification. Use single quotes ('') around any literal text characters.

Critical Rule

The Source Column Format must exactly match how your data is stored in the database. Mismatched formats will cause filtering errors in Analyzer. Always check your actual database values before configuring these settings.

Last updated

Was this helpful?