Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

----
Now that we have a few database connections (see [Setting Up Your Database Connections|PentahoDoc:01. Setting Up Your Database Connections]), the next step is to describe the physical database tables and columns that we will want to include in our [business model|PentahoDoc:00. Metadata Terminology#BusinessModel].

h1. Importing Physical Tables

Fortunately, when you import a physical table, all of the table's columns come with it, so the import is a one step exercise instead of two. You can later remove those columns that you do not want in the connection or the model.

h2. An Example Import: Importing Tables into a MySQL Connection

# Right-click (or <CTRl+click>) on the *MySQLSampleData* node in the Tree Navigator. Select the *Import Tables...* option from the pop-up menu.
# You will be prompted by a dialog with list of physical tables available in the database. Select the tables you want to include, and click *OK*. !metadata_import_tables1.png|align=center!
Drill down on your physical tables in the Tree Navigator. Notice that all of the physical columns have been imported with each table.

h2. Trimming the Physical Columns

If you would like to remove extraneous columns from your physical tables, from here it's easy to do:
# Right-click (or <CTRl+click>) on the physical table node you wish to edit in the Tree Navigator. Select the *Edit* option from the popup menu. (Note: you can also get to the Physical Table Properties dialog by double-clicking the physical table node.)
# The *Physical Table Properties* dialog displays. In the dialog's Tree Navigator, select a column you wish to remove.
# Click the *delete icon (the one with the red circle)*, to the right of the word Subject above the dialog's Tree Navigator.
# Repeat with any remaining columns that you want to remove. Click *OK* when you are done. !metadata_pcolumn_delete1.png|align=center!


h2. Defining the Physical Column Aggregations

{quote}
*Note*: This functionality will not be available until August 2009the CITRUS release (date pending).
{quote}
You are no longer limited to defining only one aggregation rule in a model. You can define multiple aggregation rules from which users can choose when they are working in the Chart Designer or other tool.
{quote}
*Note*: This feature will not be supported for users of Ad Hoc Reporting.
{quote}
In the example below, the model designer has designated three aggregation rules for PRICEEACH: Sum, Average, and Count. In the Chart Designer, (or other tool), users can decide whether they want to see the total price, average price, or the number of prices available. Metatada Editor displays a default aggregation type for a numeric column. You can choose to designate additional aggregations, when applicable.

!agglst_aggrule2.png|align=center!

To define aggregations in Metadata Editor...
# Select the column for which an aggregation must be defined.
# Under Model Descriptors, select *Default Aggregation rule*.
# Under *Aggregation rule*, select an *Aggregation Type* from the list.
# If applicable, select multiple aggregation types from the *AggregationOptional ListAggregations*. Use <CTRL+click> to make your selections.

{quote}
*Note*: There is no need to explicitly place the aggregation type in the formula definition; Metadata Editor uses your selections to generate the SQL query. See [Second Use: Physical Table Column Formulas|http://wiki.pentaho.com/display/ServerDoc2x/02.+Pentaho+Metadata+Formulas] and [Support for Multiple Aggregate Types| http://wiki.pentaho.com/display/ServerDoc2x/03.+Pentaho+Metadata+MQL+Schema] for more information.
{quote}