Scenario: Cross-join tables - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This Job extracts multi-dimensional datasets from relational database tables stored in a MySQL base. The data are retrieved using a multidimensional expression (MDX query). Obviously you need to have to know the structure of your data, or at least have a structure description (catalog) as a reference for the dataset to be retrieved in the various dimensions.

Setting up the Job

  1. Drop tMondrianInput and tLogRow from the Palette to the design workspace.

  2. Connect the Mondrian connector to the output component using a Row Main connection.

Setting up the DB connection

  1. Double-click the tMondrianInput component to display its Basic settingsview.

  2. In DB type field, select the relational database you are using with Mondrian.

  3. Select the relevant Repository entry as Property type, if you store your DB connection details centrally. In this example the properties are built-in.

  4. Fill out the details of connection to your DB: Host, Port, Database name, User Name and Password.

  5. Select the relevant Schema in the Repository if you store it centrally. In this example, the schema is to be set (built-in).

Configuring the DB query

  1. The relational database we want to query contains five columns: media, drink, unit_sales, store_cost and store_sales.

  2. The query aims at retrieving the unit_sales, store_cost and store_sales figures for various media / drink using an MDX query such as in the example below:

  3. Back on the Basic settings tab of the tMondrianInput component, set the Catalog path to the data warehouse. This catalog describes the structure of the warehouse.

  4. Then type in the MDX query such as:

    "select
       {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store
    Sales]} on columns,
       CrossJoin(
         { [Promotion Media].[All Media].[Radio],
           [Promotion Media].[All Media].[TV],
           [Promotion Media].[All Media].[Sunday Paper],
           [Promotion Media].[All Media].[Street Handout] },
         [Product].[All Products].[Drink].children) on rows
     from Sales
     where ([Time].[1997])"

  5. Eventually, select the Encoding type on the list.

Job execution

  1. Select the tLogRow component and select the Print header check box to display the column names on the console.

  2. Then press F6 to run the Job.

The console shows the result of the unit_sales, store_cost and store_sales for each type of Drink (Beverages, Dairy, Alcoholic beverages) crossed with each media (TV, Sunday Paper, Street handout) as shown previously in a table form.