modeler user's guide - baansupport.com user guide.pdf · modeler user’s guide v this...

142
BaanBIS Decision Manager 2.0 Modeler User’s Guide

Upload: others

Post on 10-Mar-2020

56 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

BaanBIS Decision Manager 2.0

Modeler User's Guide

Page 2: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

A publication of:

Baan Development B.V.P.O.Box 1433770 AC BarneveldThe Netherlands

Printed in the Netherlands

© Baan Development B.V. 2001.All rights reserved.

The information in this documentis subject to change withoutnotice. No part of this documentmay be reproduced, stored ortransmitted in any form or by anymeans, electronic or mechanical,for any purpose, without theexpress written permission ofBaan Development B.V.

Baan Development B.V.assumes no liability for anydamages incurred, directly orindirectly, from any errors,omissions or discrepanciesbetween the software and theinformation contained in thisdocument.

Document Information

Code: U7560A USGroup: User DocumentationEdition: ADate: February, 2001

Page 3: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

i

Modeler User's Guide

1 Introduction 1-1Decision Manager 2.0 architecture 1-2Procedure to create and run an ETL model 1-6Initialize the ETL Modeler 1-7Define a new ETL model 1-7Define the input for the ETL model 1-7Specify transformations 1-8Define the output of the ETL model 1-8Generate the runtime components 1-9Run the ETL process 1-9Decision Manager components 1-10ETL Modeler Concepts 1-13Dimension tables 1-13Fact tables 1-13Slow moving dimension tables 1-13Staging area 1-13Enumerates 1-14Dummy records 1-14

2 To initialize the ETL Modeler 2-1To create a Modeler database 2-1To load the BaanERP data dictionary 2-3

3 To create and modify ETL models 3-1To add a new ETL model 3-1To modify an existing ETL model 3-3

4 ETL Modeler input 4-1Baan tables 4-1To select a table from the data dictionary 4-2To define the table settings 4-3Enumerates 4-5Enumerates based on a BaanERP enumerated domain 4-6User-defined enumerates 4-7Text files 4-8To define the structure of a text file 4-9DataSource tables 4-15To create a data source 4-16

Table of contents

Page 4: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Table of contents

Modeler User's Guideii

To define the structure of the data source table 4-20Data types for Oracle data sources 4-25

5 Transformation 5-1Steps 5-1To create a step 5-2To use the Expression Builder 5-13Computed steps 5-18CleanupTree 5-19Ragged2Balanced 5-23To balance ragged trees 5-25SQL statements 5-28To create SQL statements 5-29Sample SQL statement 5-33Intermediate tables 5-34

6 ETL Modeler output 6-1Data warehouse tables 6-1Fact tables 6-2Dimension tables 6-2Slow moving dimension tables 6-3To define a data warehouse table 6-5Star schemas 6-15To create a star schema 6-15

7 Runtime components 7-1 generate the runtime components 7-1

8 Other features 8-1To export ETL models 8-1To import ETL models 8-3To check ETL Models 8-4To compare ETL models 8-5

9 ETL Runner 9-1To run a DTS package 9-1

Page 5: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Tahle of contents

Modeler User's Guideiii

Appendix A Guidelines 1Naming conventions 1Baan Tables, Text Files, Enumerates, and DataSource Tables 1Steps and Computed Steps 1Data warehouse tables 2SQL statements 2Star schemas 2Table fields 2Best practices 3Enum descriptions 3Currencies 3Handle numbers for Baan Data Navigator 3Date fields / UTC date fields 4Integer fields 4Precedence of SQL statements 4Indexes 4Steps 4Copies of dimension tables 5

Appendix B DTS packages 1

Page 6: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Table of contents

Modeler User's Guideiv

Page 7: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guidev

This document is a manual for developers who want to build new ETL models orcustomize existing ETL models in the Baan Decision Manager 2.0. Thisdocument covers the structure and the components of ETL models, and alsodescribes the rules that users must follow to comply with the standard ETLmodels delivered with the BaanBIS Decision Manager 2.0 product.

� Chapter 1, �Introduction,� introduces the ETL Modeler.

� Chapter 2, �To initialize the ETL Modeler,� describes the initialization stepsfor the ETL Modeler.

� Chapter 3, �To create and modify ETL models,� describes how you can insertand modify ETL models in the ETL Modeler database.

� Chapter 4, �ETL Modeler input,� covers the various types of input that theETL modeler can handle.

� Chapter 5, �Transformation,� describes how to transform the data that theETL Modeler imports.

� Chapter 6, �ETL Modeler output,� contains a description of the ETL Modeleroutput.

� Chapter 7, �Runtime components,� covers the settings for generatingExchange schemes, DTS packages, and data warehouse tables.

� Chapter 8, �Other features,� describes several extra features, such asexporting and importing ETL models.

� Chapter 9, �ETL Runner,� describes how to use the ETL Runner to run DTSpackages.

� Appendix A, �Guidelines,� contains the naming conventions and variousother guidelines and hints for developers.

� Appendix B, �DTS packages,� provides an overview of the DTS packagesthat the ETL Modeler generates.

About this document

Page 8: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

About this document

Modeler User's Guidevi

Additional documents� BaanBIS Decision Manager 2.0 - White Paper (P3219A XX)

� BaanBIS Decision Manager 2.0 - Release Notes DM 2.0 LA (P3220A US)

� BaanBIS Decision Manager 2.0 - Installation Guide (U7562A US)

� BaanBIS Decision Manager 2.0 - Administrator�s Guide (U7563A US)

� BaanBIS Decision Manager 2.0 - Dimension Cleaner User�s Guide(U7524A US)

� BaanBIS Decision Manager 2.0 - Developer�s Guide (U7491A US)

� BaanBIS Decision Manager 2.0 - Business Content � Purchase(U7552A XX)

� BaanBIS Decision Manager 2.0 - Business Content � Finance (U7553A XX)

� BaanBIS Decision Manager 2.0 - Business Content - Inventory Mgt(U7554A XX)

� BaanBIS Decision Manager 2.0 - Business Content � Service (U7555A XX)

� BaanBIS Decision Manager 2.0 - Business Content - E-Procurement(U7556A XX)

Page 9: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide1-1

This chapter provides the following information:

� An overview of the Decision Manager 2.0 architecture, which introduces andpositions the ETL (Extract-Transfer-Load) Modeler.

� An overview of the procedure for creating an ETL model and running theETL process. For detailed information about the procedure steps, you canrefer to the other chapters in this manual.

� A terms and definitions list, which describes the various BaanBIS DecisionManager 2.0 components.

� A description of the major concepts of the ETL Modeler.

1 Introduction

Page 10: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-2

Decision Manager 2.0 architectureThe following figure (see Figure 1) illustrates the architecture of the BaanBISDecision Manager 2.0. Each component is labeled with a number for reference inthe following section:

Figure 1 Decision Manager 2.0 architecture

The following sections describe the various components.

Data Source layer (1)

BaanBIS Decision Manager 2.0 extracts data from the BaanERP database, andsupports BaanERP 5.0c (Corelli). BaanBIS Decision Manager 2.0 can alsoextract data from Baan-related software (BaanWeb) and other sources such asMicrosoft Excel, Microsoft Access, Microsoft SQL Server, and Oracle. Forexample, the E-Procurement template in the standard BaanBIS DecisionManager 2.0 solution extracts data from a SQL Server database.

Page 11: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-3

BaanDM Exchange Schemas and BaanDM export sessions (2)

BaanBIS Decision Manager 2.0 contains templates for extracting data fromvarious modules in BaanERP. You can use Baan Exchange Schemas to extractsome of the data, and you can use specific Baan sessions to extract other,complex data are extracted using.

The BaanDM export sessions and the BaanDM exchange schemas write data totext files. These text files are loaded into the data warehouse by Microsoft DTSpackages.

The Exchange schemas and Microsoft DTS packages are generated through theETL Modeler.

Microsoft DTS packages / ETL Runner (3)

The Data Transformation Services (DTS) packages clean and transform the inputdata. Subsequently, the resulting data is written to the data warehouse. The DTSpackages are started through the ETL Runner.

Baan ETL Modeler (4)

The Baan ETL Modeler is a development tool that you can use to create ETLModels. An ETL model contains specifications for:

� The format of the data that must be exported.� The transformations that must be performed.� The joining of tables.� The data warehouse structure.

You can use the ETL Modeler to define development time actions that the ETLprocess must perform. ETL Modeler does not run those actions. After an ETLmodel is completed, BaanERP Exchange schemas and Microsoft DTS packagesare generated from the ETL model. These are the runtime components, which runthe ETL process. The exchange schemas run through the BaanERP exportsessions. The DTS packages are started through the ETL Runner.

Data warehouse (5)

The data warehouse is an SQL Server 7.0 database. This data warehouse containsfact tables, dimension tables and views, which function as input for the cubes inMicrosoft OLAP Services.

NOTE

NOTE

Page 12: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-4

MS OLAP Services with Cubes (6)

MS OLAP Services is an extension on SQL Server 7.0 to support OLAPapplications. Baan Decision Manager 2.0 delivers standard cube definitions toanalyze Baan data in the data warehouse. You can build your own cubedefinitions in this environment based on the underlying data warehouse.

Baan OLAP Client (7)

This client application is created by TopTier Software. The Baan OLAP Clientcan run in the Internet Explorer and enables you to view the data in MicrosoftOLAP cubes from various angles. In the Baan OLAP Client, you can addformulas, filters, graphs, and so on to the data. Working with the Baan OLAPClient can provide knowledge about trends, causes of events, exceptionalsituations, and other interesting facts.

The Baan OLAP client is an add-on product, and is not included in the standardBaanBIS Decision Manager 2.0 installation.

Business Objects (8)

Business Objects offers a suite of Business Intelligence applications. Based onthis suite, various packages are defined and priced as options in DecisionManager 2.0. The available packages for end-users are:

� A package for information users, that enables users to access static reportswithout modifying the reports.

� A package for business users, that enables the users to access reportsdynamically. In this case, users can work with dimensions in reports toperform aggregations or drill-down actions.

� A package for power users, that enables these users to create reports that canbe distributed to other users.

For each package, a thick-client desktop variant and a thin-client Web variant isavailable, as well as packages for system administration and system managementfunctions.

Business Objects is not included in the standard BaanBIS Decision Manager 2.0installation.

NOTE

NOTE

Page 13: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-5

Business Objects Universes (9)

Business Objects applications read data from the data warehouse through aUniverse. A Universe is a metadata layer on top of a database. The Universetranslates a technical data model into a functional data model that is easy tounderstand by end users. To create the reports, end users select elements from theUniverse. With the Universe concept Business Objects takes the complexity ofcreating SQL statements, including joins, away from the end users.

Every BaanBIS Decision Manager 2.0 business template contains a uniqueBusiness Objects universe.

Decision Manager Console (10)

The Decision Manager Console is a set of tools for use by administrators anddevelopers, and contains the following components:

� Various cube utilities, such as Process Cubes and the Dimension Cleaner.� Metadata Tools, for example, Metadata Reporter.� ETL Modeler, ETL Runner, and Generate Time Dimension.� Extraction Job Runner.� Pollution Checker.

For details about these utilities, refer to the following manuals:

� BaanBIS Decision Manager 2.0 Administrator�s Guide (U7563A US)� BaanBIS Decision Manager 2.0 Dimension Cleaner User�s Guide

(U7524A US)

Page 14: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-6

Procedure to create and run an ETL modelThe procedure to create and run an ETL model contains the following steps:

1 Initialize the ETL Modeler.2 Define a new ETL model.3 Define the input for the ETL model.4 Specify transformations.5 Define the output of the ETL model.6 Generate the runtime components.7 Run the ETL process.

You can perform Steps 1 through 6, creating the ETL Model and the runtimecomponents, in the ETL Modeler. You can perform Step 7, running the ETLprocess, by means of BaanERP export sessions and through the ETL Runner.The following figure shows the ETL Modeler�s main window.

Figure 2 ETL Modeler main window

Page 15: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-7

Initialize the ETL ModelerBefore you can use the ETL Modeler, you must perform the following one-timetasks:

� Create a Modeler database in which you can store your own ETL models.� Load the BaanERP data dictionary into your Modeler database. You will use

this data dictionary to specify the format in which tables are exported fromBaanERP.

Define a new ETL modelTo create a new ETL model, take the following steps:

1 Connect to your Modeler database.2 Define a name and some descriptive information for the new Model.

Define the input for the ETL modelYou can specify various types of input files and input tables for your ETL model:

� Baan tables.Use this option to specify the fields that must be exported from the dimensiontables in BaanERP. Based on these settings, the ETL Modeler generates anexchange scheme on the Baan Server.

� Enumerates.Use this option to generate a table that contains the elements of a BaanERPenumerated (multiple choice/drop down list) domain. You can also manuallycreate a user-specific enumerated table that contains non-Baan enumeratedvalues. An enumerated table is only necessary if you want to use theenumerated values in a dimension of an OLAP cube.

� Text files.Use this option to specify the format of ASCII files belonging to BaanERPtransaction tables. Transaction tables are exported by means of specificexport sessions, such as the Export Purchase History Data for DataWarehouse (tgedm4210m000) session. These export sessions join multipleBaanERP transaction tables and perform several data transformations. Theoutput of an export session is saved in an ASCII file. Because of the joiningand the transformations, the structure of the exported ASCII file differssignificantly from the original BaanERP transaction table. This Text filesoption can also handle ASCII files, which are exported from other, non-BaanERP applications.

Page 16: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-8

� DataSource tables.Use this option to import data from other, non-BaanERP sources such as anSQL Server database, an MS Excel file, an MS Access file, or an Oracledatabase.

Specify transformationsThe ETL Modeler can transform the data, which is read from the input files andinput tables. You can define the following transformation types:

� Steps.Use steps to join tables and to define field transformations such as stringconcatenation, arithmetic expressions, and logical operations. The result of astep is stored in an intermediate table.

� Computed steps.Only used in the standard Finance and Project ETL models. These computedsteps perform balancing and cleanup actions in tree structures, such asgeneral ledger accounts and budgets.

� SQL statements.SQL statements enable you to open up the ETL Modeler environment byadding handmade tasks. You can use these statements to define finishingprocesses, which are activated after initializing or loading the datawarehouse.

The standard ETL models contain various SQL statements, which generate viewsafter loading the data warehouse tables.

Define the output of the ETL modelThe ETL Modeler contains two options, which you can use to define the outputof the ETL Model:

� Data warehouse tables.Here, you can specify the structure of the data warehouse tables, in which theoutput of the ETL model is stored.

� Star schemas.In a star schema, you can define the relationship between a fact table and therelated dimension tables.

The standard Inventory model contains a star schema INV_HISTORY. In thisschema, the inventory-history fact table is joined to the Items, Companies, andWarehouses dimension tables. These joins are required to combine theinformation of these four tables.

EXAMPLE

EXAMPLE

Page 17: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-9

Generate the runtime componentsBefore you can run the actions defined in your new model, you must generate thefollowing runtime components:

� Exchange schemes.� Company groups.� DTS packages.

Generation of these runtime components requires the following settings:

� Baan settings.Here, you must define the Exchange schemas and company groups that mustbe generated. These schemas and groups used by the export sessions inBaanERP.

� DTS settings.Here, you must specify the server on which the DTS packages are generated.You can run these DTS packages to perform the transformations and loadactions defined in your ETL model.

� Data warehouse settings.Here, you must specify your data warehouse database. The ETL Modelercreates some standard tables in the data warehouse during the generation ofthe DTS packages.

Run the ETL processTo run the actions defined in the ETL model, you can use one of the followingmethods:

� Export data from BaanERP.To export data, you must run specific BaanBIS Decision Manager 2.0 exportsessions, such as the Export Purchase History Data for Data Warehouse(tgedm4210m000) session. In these export sessions, you must enter the nameof a company group. The export session exports data from the companies inthe company group and executes the accompanying exchange scheme. Theexported data is stored in ASCII files (.txt files).

Page 18: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-10

� Run DTS packages.To carry out ETL model actions, such as reading the input tables/files,performing transformations and loading the data warehouse tables, the usermust run the corresponding DTS packages. Examples of DTS packagesinclude UpLoad, JoinInStaging, LoadDW, and Overall. To run DTSpackages, you must use the ETL Runner.For more information about Microsoft DTS packages, refer to Appendix Band the BaanBIS Decision Manager 2.0 Administrator�s Guide,(U7563A US).

Decision Manager componentsComponents of the Baan Decision ManagerTerm DescriptionAggregation Precalculated results on levels higher than the stored levels,

such as date, customer, and item. Aggregation speeds theresponse time during analysis time.

B5C20 The fixed name of the data warehouse.Baan DecisionManager

An end-to-end solution based on an open EnterpriseIntelligence Framework that contains best-of-breedcomponents. Decision Manager also delivers ready-to-implement business templates, designed to analyze keybusiness processes in an enterprise. Using the businesstemplates enables you to make dynamic business decisionsright out of the box. Baan Decision Manager contains thefollowing components:- Baan ETL Modeler.- Baan Intelligence Warehouse.- Microsoft OLAP Server.- Business Templates.- Baan Decision Manager Console.

Baan Exchange A Baan module used to export data from the Baan RDBMS toa file.

Baanlogical/physicalcompany

In BaanERP, all tables are stored in a database. Such adatabase is called a company. All tables that logically belongtogether are called a logical company. Usually, a BaanERPsystem contains more than one logical company. Tables thatare shared between logical companies, such as a Customertable, also have a physical company. The physicaldatabase/company is the place where these tables arestored.

Page 19: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-11

BCP Bulk Copy Program. A Microsoft file format that is used todescribe exported data.

Businesstemplate

A set of dimension and fact definitions, extraction schemes,and cubes that cover a particular business area. For example,Sales. Business templates are used to extract data from theBaan transactional system, for example, BaanERP, and storethe data in the Baan Enterprise Intelligence Warehouse tomake the data available for analysis in the Baan EnterpriseDecision Navigator.

Company See: Baan logical/physical company.Cube A set of related dimensions, which defines an n-dimensional

manifold. The cube is the central metadata object recognizedby OLE DB for OLAP.

Data warehouse A data warehouse is an integrated collection of data used inthe support of management�s decision needs.

Denormalization A process used to reduce the number of reference tables inthe data warehouse database: A number of intermediatetables are joined and the output is saved in a single resulttable. The lower number of references results in a betterperformance of the data warehouse database. However,because of the joining of tables, redundant information isstored. The standard ETL Models perform variousdenormalizations.

Dimension Point of view from which you can look at your data, forexample, Time, Product, or Customer. A cube has a set ofdimensions. A Plato dimension can contain only onehierarchy with one or more levels. The measure dimensioncannot contain a hierarchy and has only one level.

DM Decision Manager.DM CompanyGroup

A group of Baan companies for which data is exportedtogether.

DTS Data Transformation Services.DW Data warehouse.Element A unit within a dimension. Each level of a dimension contains

one or more elements with the same meaning (granularity).For example, all customers or regions are clustered togetherinto one level.

ETL process ETL stands for Extract, Transform, Load. The ETL processextracts data from BaanERP or other data sources,transforms the data and finally loads the data in the datawarehouse. The ETL process is run by means of BaanERPexport sessions, BaanERP Exchange schemas and MicrosoftDTS packages. The Exchange schemas and DTS packagesare generated through the ETL Modeler.

Page 20: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-12

ETL Runner ETL stands for Extract, Transform, Load. The ETL Runner isa Baan DM utility, which is used to perform the actionsdefined in an ETL Model by running Microsoft DTS packages.

Fact Numeric information available in the Baan EnterpriseDecision Navigator, for example, revenue, quantities, andspent hours.

File PoolDirectory

The directory on the Baan host in which the flat files from theexport process are written.

FTP File Transfer Protocol. A mechanism to transfer data over anetwork from one computer to another.

Measure A quantity that you can analyze. Each cube has at least onemeasure. For example, unit sales, average sales, and grossmargin. See also: fact.

Metadata Set of instructions that describes the transformation of databetween two different data storages. With this set ofinstructions you can retrieve data in an earlier stage oftransformation or the original OLTP data storage.

Multicurrency System by which multiple home currencies (HCs) can bestored simultaneously. In BaanERP, you can store up to threeHCs.

OLAP Online Analytical Processing. A category of softwaretechnology that enables analysts and managers to gaininsight into data through fast, consistent, and interactiveaccess, and a wide variety of possible views of information.OLAP functionality is characterized by dynamicmultidimensional analysis of consolidated enterprise data thatreflects the real dimensionality of the enterprise asunderstood by the user.

Raggeddimension

An example of a ragged dimension is a ledger accountdimension. In fact, you cannot distinguish levels in thosedimensions. Some elements have two levels of children; otherelements have four or five levels. To balance thesedimensions, Baan will introduce dummy elements so thateach element with the same number of parents will have thesame number of children. To create the dummy elements,Baan will add a question mark or minus sign to the code ofthe parent.

Template The collection of steps and activities to be performed toexport data from Baan, to store the data in the datawarehouse, and to make the data for end user analysis.

Transactionalsystem

A system for the automation of business processes by storingevery business transaction in a database. Orders, purchases,goods transfers, and payment receipts are typical businesstransactions. BAAN IV and BaanERP are examples oftransactional systems.

Page 21: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-13

ETL Modeler ConceptsThis section covers a number of major concepts that are used in the variouscomponents of the ETL models.

Dimension tablesDimension tables contain data, on which the dimensions of an OLAP cube can bebased. These dimensions are distinct categories for analyzing business data. Themeasures in the cube, which originate from a fact table, are analyzed against thedimensions. Typical dimensions are time, customer, and item breakdowns.

Fact tablesA fact table contains the numeric data that corresponds to the measures of anOLAP cube. Typical measures are cost, sales and budget data. In MicrosoftOLAP, this type of measures is analyzed against the various dimensioncategories of a cube.

Slow moving dimension tablesThese tables contain the same type of data as normal dimension tables, which isdata used in the dimensions of OLAP cubes. Slow moving dimension tables,however, keep a history of the changes to the records. If you change the contentsof a record in a slow moving dimension table, the new values are stored in a newrecord. The old values are still available in the old record. The usage of slowmoving dimension tables can prevent incorrect aggregations. For a detaileddescription of slow moving dimension tables, refer to Chapter 4, �ETL ModelerOutput.�

Another term for slow moving dimensions is �Slowly changing dimensions�.

Staging areaThe staging area consists of a set of tables, which are used for the initial uploadand the transformations. The ETL process loads data initially into so calledupload tables. Subsequently, various transformations can be performed. Theresults of these transformations are stored in intermediate tables. Finally, the datafrom the intermediate tables is uploaded to data warehouse tables. Together, theupload tables and intermediate tables form the staging area.

NOTE

Page 22: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-14

The tables of the staging area and the data warehouse tables are located in thesame database: B5C20. Therefore, only a virtual separation exists between thestaging area and the data warehouse. In SQL Server, you can distinguish thevarious table types by their names:

� Upload table names have a UP_ prefix.� Intermediate table names have a TR_ prefix.� Data warehouse table names have a DW_ prefix.

For more details about table names, refer to �Naming Conventions� inAppendix A, �Guidelines.�

EnumeratesAn enumerate is a multiple-choice list. Enumerates are used in drop down lists.The ETL Modeler can handle the following two types of enumerates:

� Enumerates based on a BaanERP domain. The various choice options areimported from the BaanERP data dictionary.

� Other, user-specific enumerates. The choice options are defined manually.

Dummy recordsYou can use dummy records to solve problems regarding empty reference fieldsin fact tables.

In the BaanERP sales history, sales orders are usually linked to a sales representative.Information about the sales representatives is stored in the BaanERP Employees table.For some sales orders, the Sales Representative field can be empty, which causes aproblem during the OLAP analysis.

Sales History

Sales Order Number Amount Sales Representative

1 1000 A

2 2000 B

3 5000 C

4 7000

NOTE

EXAMPLE

Page 23: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-15

Consider the following OLAP views:

� Total Sales Order Amount: 15000 (1000+2000+5000+7000).

� Sales Order Amount per Sales representative: A-1000, B-2000, C-5000,Total: 8000.The amount for sales order 4 (7000) is missing in this last view, because thissales order is not assigned to a sales representative.

Adding dummy records can solve this problem. You can link sales historyrecords that are not assigned to a sales representative to a dummy salesrepresentative:

� During the upload process, a dummy employee record is generated. TheEmployee Code is filled with underscores (__) to designate an unknownemployee.

� If the Sales Representative field in a sales history record is empty, the fieldis also filled with underscores (__).In this way, all sales history records are linked to a sales representative.

Sales History

Sales Order Number Amount Sales Representative

1 1000 A

2 2000 B

3 5000 C

4 7000 ______

Now, both OLAP views show the same total:

� Total Sales Order Amount: 15000 (1000+2000+5000+7000).

� Sales Order Amount per Sales representative: A-1000, B-2000, C-5000,�______�-7000, Total: 15000.

EXAMPLE

Page 24: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Introduction

Modeler User's Guide1-16

Page 25: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide2-1

Before you can use the ETL Modeler, you must perform the following one-timetasks:

1 Create a Modeler database in which you can store your own ETL models.2 Load the BaanERP data dictionary into your Modeler database. You will use

this data dictionary to specify the format in which tables are exported fromBaanERP.

To create a Modeler databaseTo create a new Modeler database, take the following steps:

1 Start the ETL modeler and click the Cancel button in the Open ModelDatabase dialog box.

Figure 3 Open Model Database dialog box

2 To initialize the ETL Modeler

Page 26: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To initialize the ETL Modeler

Modeler User's Guide2-2

2 The following message appears. Click the OK button in the messagewindow.

Figure 4 Message window

3 The ETL Modeler main window appears. Click the Create New Model DBcommand on the Tools menu.

Figure 5 Create New Model DB command

4 Enter the desired parameters in the Create empty Modeler DB window andclick the OK button.

The Create empty Modeler DB dialog box appears.

Figure 6 Create emptyMmodeler DB dialog

Page 27: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To initialize the ETL Modeler

Modeler User's Guide2-3

The Create Empty Modeler dialog box contains the following fields:

� Server.The server on which the Modeler database is created.

���� Authentication.Specify the authentication parameters to log on to the server.

���� Use Windows NT authentication.If you select this option, the process uses your Windows NT user account andpassword to connect to the SQL Server environment.

���� Use SQL Server authentication.If you select this option, the process uses an SQL Server user account andpassword to connect to the SQL Server environment.

���� Username.The SQL Server user account used during the creation of the new database.Usually, the sa account is used. The sa account is the SQL Server databaseadministrator account.

���� Password.The SQL Server password used to connect to the SQL Server environment.

���� Database.The name of the new Modeler database.

To load the BaanERP data dictionaryTo use or create ETL models that use BaanERP tables as input, you must loadthe BaanERP dictionary into your Modeler database. The BaanERP dictionarycontains information about the table definitions and domains of your BaanERPinstallation, including the customizations. This dictionary information in the ETLModeler is used to generate the export format for BaanERP dimension tables.

To import the Baan dictionary, take the following steps:

1 Export the dictionary information from BaanERP.

2 Start the Export Table Definitions (tgedm2220m000) session (see Figure 7).

Page 28: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To initialize the ETL Modeler

Modeler User's Guide2-4

3 Select all packages and enter a destination directory.

Figure 7 Export Table Definitions session

The export directory on the BaanERP server contains the following files:

Figure 8 Export files

The size of the export files varies for each BaanERP installation.

4 If BaanERP runs on a Unix server, you must first transfer the export filesfrom the Baan server to a Windows directory in your network, which you canaccess through the ETL Modeler.If BaanERP runs on a Windows NT server, you must check whether the ETLModeler can read files from the export directory on the BaanERP server. Ifnecessary, transfer the files to a directory that the ETL Modeler can access. Ifyou use FTP to transfer the files, you must select the ASCII transfer mode.

Page 29: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To initialize the ETL Modeler

Modeler User's Guide2-5

5 Start the ETL Modeler and connect to your Modeler database.

Figure 9 Open Modeler Database dialog box

The following list provides a description of the important fields in the OpenModel Database Dialog box:

���� Server.The server that contains the Modeler database.

���� Authentication.Specify the authentication parameters to log on to the server.

���� Database.The name of the Modeler database.

6 The ETL Modeler main window appears. On the Tools menu, click theLoad Data Dictionary command.

Figure 10 Load Data Dictionary command

Page 30: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To initialize the ETL Modeler

Modeler User's Guide2-6

7 Now the Load Data Dictionary dialog box appears. Enter or select the nameof the directory, which contains the BaanERP data dictionary export files.Click Load to start the import.

The following message appears when the upload is complete:

Figure 11 Upload completed message

8 Close and restart the ETL Modeler. Your ETL Modeler is now ready toimport or develop models.

Page 31: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide3-1

This chapter covers the following topics:

� How to create a new ETL model.� How to modify an existing ETL model.

To add a new ETL modelTo create a new ETL model, take the following steps:

1 Connect to your Modeler database: start the ETL Modeler and enter therequired information in the Open Model Database dialog box.

2 Select the Models folder with the right mouse-button and click the NewModel command.

Figure 12 New Model command

3 The New Model dialog box appears. Enter the name of the new model.

Figure 13 New Model dialog box

3 To create and modify ETL models

Page 32: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To create and modify ETL models

Modeler User's Guide3-2

4 Enter descriptive information (metadata) in the Descriptive Info textwindow. This text window appears in the lower left corner of the ETLModeler main window.

Figure 14 ETL Modeler main window with Descriptive Info window

You define descriptive information not only for the ETL model itself, but also forthe various components of the ETL model, such as the fields of the upload tablesand fields in intermediate tables. You can enter four types of descriptiveinformation:

���� Business.Use this to enter business related information. For example, you can use atext such as �The Sales turnover in the home currency of the company� asdescriptive information for a table field.

���� Technical.Information that is only used by developers.

���� Source.Can be used to specify the table fields, which are used as a hyperlink to thecurrent field, for example, tdpur045.amnt.

���� Computation.Used for calculated fields. Specify the formula that calculates the field. Forexample: Profit = Turnover - Costs.

Page 33: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To create and modify ETL models

Modeler User's Guide3-3

The Netadata Reporter uses various types of descriptive information, exceptTechnical information.

For details about the Metadata Reporter tool, refer to the BaanBIS DecisionManager 2.0 Administrator�s Guide (U7563A US).

To modify an existing ETL modelYou can only modify a model when the model is locked. Locking protects amodel against changes by other ETL Modeler users. Only you can modify amodel that you yourself lock. Other users can only view the contents of themodel.

To modify an existing model, take the following steps:

1 Lock the model: select the model with the right mouse-button and click theLock Model command (see Figure 15).

Figure 15 Locking a model

New models are locked automatically at the moment of creation.

NOTE

NOTE

NOTE

Page 34: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

To create and modify ETL models

Modeler User's Guide3-4

2 Perform the desired changes. To expand the selected model�s folder andchange the model, you can add, modify, or delete model components. Thevarious component types are discussed in greater detail in the Chapters 4, 5, 6and 7.

Figure 16 Expanded Model folder

3 Unlock the model, which you can do if you completed the desired changes,you can unlock the model. Simply select the model with the right mouse-button and click Unlock Model on the shortcut menu.Other ETL Modeler users can modify the model from now on.

Figure 17 To unlock a Model

Page 35: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide4-1

An ETL Model can handle the following types of input:

� Baan tables.� Enumerates.� Text files.� DataSource tables.

Baan tablesYou can use this option to define the export settings for BaanERP dimensiontables. You can select tables from the Baan data dictionary in the ETL Modelerrepository. For each table, you can select the fields that must be exported. Basedon the specified table settings, the ETL Modeler generates an exchange schemeon the BaanERP server.

The exchange schemes perform a very straightforward export action. No fieldtransformations or currency conversions occur during the export. This exportmethod is less useful for fact tables. During the export of a fact table, allfinancial facts must be converted to a reporting currency.

To define a Baan table in your ETL model, take the following steps:

1 Select a table from the data dictionary.2 Define the table settings.

4 ETL Modeler input

Page 36: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-2

To select a table from the data dictionarySelect the Baan Tables option with the right mouse-button and click Add Newon the shortcut menu. The Baan Tables window appears, as shown in thefollowing figure.

Figure 18 Baan Tables window with expanded folder structure

You can now expand the folder structure and select the desired Baan table.Finally, click the Add button to include the Baan table in your ETL model.

Page 37: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-3

To define the table settingsAfter you select a table, the Baan Column selection window appears, as shown inthe following figure:

Figure 19 Baan Column Selection window

All columns of the BaanERP table are displayed. To specify the fields you wantto export from the BaanERP table, simply select the Selected check box. Youalso must define an intermediate table name.

Important fields

The Baan Column Selection window contains the following important fields:

� Intermediate Table Name.During the execution of an ETL model, the exported Baan data is imported inan upload table (UP-table) in the SQL Server database. This upload table isused for temporary storage. The records in the upload table function as inputfor the transformation process.Naming convention: UP_<table name>.

Page 38: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-4

� Add dummy record(s).For dimension tables, you must always select this check box. This will add adummy record to your upload table for every exported company number.Dummy records are used to solve problems regarding empty reference fieldsin fact tables. For more information, refer to �ETL Modeler Concepts,� inChapter 1, �Introduction.�

If you select this check box, an extra column, Dummy Value, appears. In thiscolumn you can specify the values for the various fields of the dummy recordto be added. See also the description of the Dummy Value column.

� Selected.Use this check box to indicate the fields that must be exported from theBaanERP table.

� Alias.A descriptive field name, used in the upload table in SQL Server. The alias isgenerated automatically if you select the Baan table from the dictionary. Youcan change the alias name if necessary.

� Field Code/Domain/Type/Length/Depth.Display fields that provide information about the original BaanERP tabledefinition.

� Dummy Value.This column only appears if you select the Add Dummy record(s) checkbox. The upload process automatically fills in the fields of the dummyrecords with the dummy values specified here. Dummy values foralphanumeric fields (string fields) and date fields must be enclosed by doublequotes.

The following item is an example of a dummy value for the Name field ofthe Employee table:

�Unknown Employee�

If you do not specify a dummy value, the following default values areapplied:

− For empty numeric fields: 0.− For empty alphanumeric fields: underscores, (______), the number of

underscores equals the field length.− For empty date fields: 18000101.

Page 39: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-5

� Null Value.Some records in the Baan table can contain empty fields, for example anemployee record with an empty Search Key field. Such an empty fieldcontains a zero. During the upload process, these empty fields are filled withthe value specified in the Null Value field. Values for alphanumeric fields(string fields) and date fields must be enclosed by double quotes.

The following item is an example for the Search Key field of the Employeetable:

�Empty Search Key�

If you leave the Null Value field blank, the following defaults are applied:

− For empty numeric fields: 0.− For empty alphanumeric fields: Underscores (__), the number of

underscores equals the field length.− For empty date fields: 18000101.

� Description.A brief field description, taken from the Baan dictionary.

EnumeratesYou can use this option to create a dimension table that contains the elements ofa BaanERP enumerated (multiple choice/drop down list) domain or auser-specific enumerated domain. This option is useful if you want to use theenumerated domain as a dimension in an OLAP cube.

Two types of enumerates exist:

� Enumerates based on a BaanERP enumerated domain.� User-defined enumerates.

Page 40: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-6

Enumerates based on a BaanERP enumerated domainTo create an enumerate, you must select the Enumerates folder and click theAdd New command. As a result, the Baan Enum dialog box appears.

Figure 20 Enumerate table based on a BaanERP domain

Important Fields

The Baan Enum dialog box contains the following important fields:

���� Table Name.The name of the table in which the enumerated values must be stored.Naming convention: UP_<Table Name>.

� Baan Enumerate.Indicates that a BaanERP enumerated domain is used as input for the enumtable.

� Enum Domain.The BaanERP enumerated domain on which the enum table is based. Youcan select this domain from a drop down list.

Page 41: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-7

� Value/Code/Description.Information about the elements of the selected domain. These fields are filledautomatically with domain information from the Baan dictionary in the ETLModeler database.

The following item is an example of an enum table based on a BaanERP domain:

The Financial Integration Mapping table in the Finance ETL model contains a fieldTransaction_Origin. In BaanERP, this field is linked to the tctror domain. This domaincontains 30 different Transaction Origin types, such as:� Purchase.� Sales.� Warehousing (SRV Manual).� Warehousing (Consignment).The contents of the tctror domain are stored in a enum table in the data warehouse,because the Transaction Origin is used as a dimension in a Microsoft OLAP cube.

The ETL Runner performs a check on the descriptions in the enum table. Somedescriptions, such as Language and Position are not accepted because thesedescriptions are internal ODBC terms. These descriptions must be changed to,for example, Language Code and Position Number. However, in BaanEnumerates, the descriptions are imported from the Baan dictionary and cannotbe changed. Therefore, you must change the enumerate into a user-definedenumerate, and enter the descriptions manually.

User-defined enumeratesThe ETL Modeler can handle enum (multiple choice) fields, which you cancreate manually, or which you can export from applications other than BaanERP,for example, Baan E-Procurement or a non-Baan application.

Suppose the Items table of an external application contains a Colorcode field. Thepossible values are 1, 2 and 3 (= red, white and blue). You can create a user defined enumtable to link these numeric codes to the corresponding color names. Now you can use thecolor as a dimension for a Microsoft OLAP cube. See also the following screenshot.

To create a user defined enumerate, take the following steps:

1 Add a new Baan Enumerate.

2 Enter the table name.

3 Select the User Defined Enum option.

4 Click the + button to add a numeric value and the value�s description

NOTE

EXAMPLE

Page 42: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-8

The following figure (see Figure 21) shows the Enumerates dialog box:

Figure 21 User defined enumerate

Text filesText files contain records in ASCII format, which are exported from anyapplication. Use this option to load the contents of:

� Text files.Contain the records of BaanERP fact tables. To generate this type of text file,you must run a BaanBIS Decision Manager 2.0 export session on theBaanERP server such as the Export Purchase History Data for DataWarehouse (tgedm4210m000) session. Usually, multiple BaanERP facttables are merged into one ASCII file during the export. Therefore, thestructure of the exported ASCII file differs significantly from the fact table�sdefinition in BaanERP.For details about using export sessions, refer to the BaanBIS DecisionManager 2.0 Administrator�s Guide (U7563A US).

� Text files containing records that are not exported form BaanERP.For example, a handmade ASCII file whose columns are separated by a TAB,or an ASCII file which was generated by exporting data from a non-Baanapplication.

Do not use the text files for ASCII files that contain records that were exportedfrom BaanERP dimension tables. This type of ASCII file is handled by the BaanTables option. For more information, refer to the previous sections in thischapter.

NOTE

Page 43: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-9

To define the structure of a text fileThe layout of the records in a text files is not known by the ETL Modeler.Therefore, you must specify the structure of a text file manually. To define thestructure for a new text file, select the Text files folder with the right mouse-button and click Add New on the shortcut menu. Now, the Text File Definitiondialog box appears.

Figure 22 Text File Definition dialog box

Use this dialog box to specify the format of the text file from which you want toload data. You can create the format in the following two ways:

� Specify the format manually by clicking the + button.� Generate the format, based on a bcp file.

Fields

The Text File Definition dialog box contains the following important fields:

� Table Name.The name of the table into which the contents of the ASCII file are uploadedinitially. From this upload table, the records are transformed or loaded intothe data warehouse.Naming convention: UP_<table name>.

Page 44: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-10

� Text File Name.The name of the ASCII file that must be uploaded.

Only specify the name. Do not specify the path here. The path is specified inthe ETL Runner at the moment the upload process is started.

� Add Dummy record(s).Only select this check box if the records in the text file finally will be storedin a dimension table. If you select this check box, a dummy record is added toyour upload table. Dummy records are used to solve problems with emptyreference fields in fact tables. For more information, refer to �ETL ModelerConcepts� in Chapter 1, �Introduction.�

� Selected.Indicates whether the field is imported in the upload table.

� Field Name.A name, used as column name in the upload table in SQL Server.

� Data Type.The data type of the field. You can select one of the following data typesfrom a drop down list:

− Bit− Byte.− Tinyint.− Smallint.− Integer.− Long.− Decimal.− Numeric.− Float.− Double.− Real.− Char.− Varchar.− Nchar.− Nvarchar.− Text.− Ntext.− String.− String_mb.− Enumerated.− Date.− Time.

NOTE

Page 45: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-11

− Smalldatetime.− Datetime.− Timestamp.− Money.− Smallmoney.− Cursor.− Uniqueidentifier.− Binary.

� Length.The length of the field.

� Precision.The total number of digits in a numeric data type.

� Scale.The number of digits after the decimal sign in a numeric value.

� Dummy Value.This column only appears if you select the Add Dummy record(s) checkbox. The upload process automatically fills in the fields of the dummy recordwith the dummy values specified here. Dummy values for alphanumericfields (string fields) and date fields must be enclosed by double quotes.

If you do not specify a dummy value, the following defaults are applied:

− For empty numeric fields: 0.− For empty alphanumeric fields: Underscores (__). The number of

underscores equals the field length.− For empty date fields: 18000101.

� Null Value.The value that will be applied if the field contains a zero. Values foralphanumeric fields (string fields) and date fields must be enclosed by doublequotes.

The following defaults are applied, if you do not specify a null value:

− For empty numeric fields: 0.− For empty alphanumeric fields: Underscores (__). The number of

underscores equals the field length.− For empty date fields: 18000101.

� Description.A brief field description.

Page 46: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-12

Important buttons

The Text File Definition dialog box also contains the following importantbuttons:

� Check.If you click this button, the ETL Modeler checks the flat file definition. Everyfield name must be unique, spaces are not permitted in field names, and soon.

� Import bcp.Click this button to generate the flat file definition from a bcp file. Bcp filescontain information about the structure of ASCII files, such as field names,data types, field length, and field separator. After you click the Import bcpbutton, you can select the desired bcp file in the Browse for BCP File dialogbox.

Figure 23 Browse for BCP File dialog box

Page 47: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-13

The following figure (see Figure 24) shows an example of a bcp file.

Figure 24 Sample bcp file

���� Index.Click this button to define one or more indexes on the upload table. In almostevery situation, this button enables you to define a unique primary key for atable. Points of attention:

− Define a unique primary key if the contents of the upload table aretransferred directly to a data warehouse table. This prevents thegeneration of records with duplicate key values.

− Define indexes if the upload table must be joined with some other tables.In this case, the indexes must contain the fields that are used in the joins.This step increases the performance.

− A unique primary key is mandatory for intermediate tables, which areinput for a slow moving dimension table.

− If the data in the text file was exported form BaanERP, the upload tableusually contains data from multiple Baan company numbers. Thereforeinclude the LogComp field in every index.

Page 48: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-14

The following figure (see Figure 25) shows the Indexes dialog.

Figure 25 Indexes dialog box

Fields

The Fields dialog box contains the following important fields:

���� Name.The name of the index.

���� Primary.The primary key is used to uniquely identify each record in the table. Theprimary key does not accept zero values.

���� Unique.In a unique index, no two rows can have the same index value. In this way,duplicate index or key values are prohibited. The system checks for duplicatekey values, each time a record is added. The primary key must always beunique.

Page 49: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-15

� Clustered.A clustered index physically sorts the table. The records in the table arestored in the same order as the indexed order of the key values. A table cancontain, at most, one clustered index.

The Items table contains a clustered index on the ItemCode field. The records in thetable are physically sorted on the ItemCode.

You can increase the search and query performance by defining clusteredindexes on:

− Fields, which are often searched for ranges− Unique fields− Fields, which are used frequently to sort the data retrieved from a table

For more detailed information about indexes, see the SQL Server documentation.

Buttons

The Text File Definition dialog box also contains the following buttons:

� +: Adds a new index.

� X: Deletes an index.

� >: Moves fields from the Available Fields to the Fields in Index list.

� <: Moves fields from the Fields in Index to the Available Fields list.

� UP ARROW up DOWN ARROW keys: Change the sequence of the fields inthe index.

DataSource tablesUse this option to import data from external (non-BaanERP) sources. Thefollowing data source types are supported:

� SQL Server database.� MS Excel file.� MS Access file.� Oracle database.

EXAMPLE

NOTE

Page 50: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-16

To define an upload table that is based on an external data source, take thefollowing steps:

1 Create a data source.

2 Define the structure of the data source table.

Therefore, first a data source is created, and subsequently tables can be based onthis data source.

To create a data sourceA data source provides a connection to an external file or database.

To define a new data source, in the Management folder, select DataSourceswith the right mouse-button, and click Add New in the shortcut menu. The DataSource dialog box appears.

The upper part of his dialog box contains the fields DataSource Name and DataSource Type.

Figure 26 Upper part of Data Source dialog box

Fields

The Data Source dialog box contains the following important fields:

� DataSource Name.Use a clear name, which indicates the content of the data source.

� DataSource Type.You can select SQL Server, Microsoft Excel, Microsoft Access, or Oracle.

The layout of the lower part of this dialog box depends on the selected datasource type.

Page 51: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-17

SQL Server

If you select the SQL Server data source type, the dialog box looks likethefollowing:

Figure 27 SQL Server data source type

Important fields

If you select the SQL Server data source type, the lower portion of the DataSource dialog box contains the following important fields:

� SQL Server.The server on which the SQL server database resides.

� Authentication.Specify the authentication parameters to log on to the server.

� Database.The SQL server database to which the data source must connect.

Page 52: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-18

Microsoft Excel

In case of a Microsoft Excel data source, the following dialog box appears:

Figure 28 Microsoft Excel data source

Important fieldsThe Data Source dialog box with the Microsoft Excel data source includes thefollowing important fields:

� Excel file.The name of the Microsoft Excel spreadsheet, including the path, from whichyou want to import data.

� User/Password.The user code and password used to open the spreadsheet. This only appliesto protected spreadsheets.

Microsoft AccessIf you define a Microsoft Access data source, the dialog box looks like thefollowing:

Figure 29 Microsoft Access data source

Page 53: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-19

Important fields

The Data Source dialog box with data source Microsoft Access includes thefollowing important fields:

� Access file.The name of the Microsoft Access database file, including the path, which thedata source must open.

� User/Password.The user code and password used to open the Access database.

Oracle

For an Oracle data source, the following dialog must be completed:

Figure 30 Oracle data source

Important fields

The Data Source dialog box with data source Oracle includes the followingimportant fields:

���� Oracle Server.The server on which the Oracle database resides.

���� User/Password.The user code and password used to open the Oracle database.

���� Schema.The Oracle schema from which the data source must read data.

Page 54: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-20

To define the structure of the data source tableAfter you create a data source, you can define the structure of tables or files fromwhich you want to import data.

Select the select DataSource Tables folder with the right mouse-button andclick Add New on the shortcut menu. Now, the Data Sources window appears:

Figure 31 Data Sources window

Use the browse features in this window to select the a table or view from thedesired data source.

Page 55: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-21

After you select a table or view, the Data Source Table Column Selectiondialog box appears.

Figure 32 Data Source Table Column Selection dialog box

Use this dialog to define the desired field settings.

Page 56: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-22

Important fields

The Data Source Table Column Selection dialog box includes the followingimportant fields:

� SQL Table name.The data source table or spreadsheet from which you read the data.

� Table Name.The name of the intermediate table in which the contents of the data sourcetable are uploaded initially. From this upload table, the records aretransformed or loaded into the data warehouse.Naming convention: UP_<table name>.

� Data Source.Name of the data source that contains the input table.

� Add Dummy record(s).Always select this check box for dimension tables. This will add a dummyrecord to your upload table. Dummy records are used to solve problemsregarding empty reference fields in fact tables. For more information, refer to�ETL Modeler Concepts,� in Chapter 1, �Introduction.�

� Selected.Select this check box to import this field in the upload table.

� New Name.A descriptive field name, used in the upload table in SQL Server. This nameis generated automatically when you select the data source table.

� Field Name/Data Type/Length/Precision/Scale.Display fields that provide information about the original data source tabledefinition

� Dummy Value.This column only appears if you select the Add Dummy record(s) checkbox. The upload process automatically fills the fields of the dummy recordwith the dummy values specified here. Dummy values for alphanumericfields (string fields) and date fields must be enclosed by double quotes.

The following defaults are applied, if you do not specify a dummy value:

− For empty numeric fields: 0.− For empty alphanumeric fields: Underscores (__). The number of

underscores equals the field length.− For empty date fields: 18000101.

Page 57: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-23

Buttons

The Data Source Table Column Selection dialog box also includes thefollowing important buttons:

� Refresh.Click this button if the database administrator modified the structure of thedata source table, which is a rare and unlikely situation. A warning appears ifthe structure of the upload table differs from the data source table definition.Subsequently, the following dialog box appears:

Figure 33 Difference between old and new table definition window

Here, you can accept or reject the changes. If you click the Accept button, theupload table structure is synchronized with the new data source tabledefinition. In this synchronization, new fields are added, deleted fields areremoved, and so on.

� Index.Click this button to define one or more indexes. In almost every situation, thisbutton enables you to define a unique primary key for a table. Points ofattention:

− Define a unique primary key if the contents of the upload table aretransferred directly to a data warehouse table. This prevents thegeneration of records with duplicate key values.

− Define indexes if the upload table must be joined with some other tables.In this case, the indexes must contain the fields that are used in the joins.This increases the performance.

Page 58: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-24

− A unique primary key is mandatory for intermediate tables, which areinput for a slow moving dimension table.

Figure 34 Indexes dialog box

FieldsThe Indexes dialog box contains the following important fields:� Name.

The name of the index.� Primary.

The primary key is used to uniquely identify each record in the table. Theprimary key does not accept zero values.

� Unique.In a unique index, no two rows can have the same index value. In this way,duplicate index or key values are prohibited. The system checks for duplicatekey values each time a record is added. The primary key must always beunique.

� Clustered.A clustered index physically sorts the table. The records in the table arestored in the same order as the indexed order of the key values. A table cancontain a maximum of one clustered index.

For more detailed information about indexes, see the SQL Server documentation.NOTE

Page 59: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-25

Data types for Oracle data sourcesSome inconsistencies exist between Oracle data types and SQL Server datatypes. The structure of character, number, and date data types in Oracle differsfrom the structure of corresponding SQL Server data types. This restricts thepossibilities for reading Oracle tables through the ETL Modeler.

For information about the previously mentioned restrictions, refer to thefollowing table:

Inconsistency in data typesOracle 7.4.3 SQL Server 7Character Data types

Character data is stored in strings, withbyte values corresponding to thecharacter encoding scheme (generallycalled a character set or code page).The database's character set isestablished when you create thedatabase, and never changes.

CHAR DatatypeThe CHAR datatype stores fixed-lengthcharacter strings. When you create atable with a CHAR column, you mustspecify a column length (in bytes, notcharacters) between 1 and 255 for theCHAR column (default is 1).

VARCHAR2 DatatypeThe VARCHAR2 datatype storesvariable-length character strings. Whenyou create a table with a VARCHAR2column, you specify a maximumcolumn length (in bytes, notcharacters) between 1 and 2000 forthe VARCHAR2 column.

Character Data types

Char[(n)]Fixed-length non-Unicode characterdata with length of n characters. nmust be a value from 1 through 8,000.Storage size is n bytes.Nchar(n)Fixed-length Unicode character data ofn characters. n must be a value from 1through 4,000. Storage size is twotimes n bytes.Varchar[(n)]Variable-length non-Unicode characterdata with length of n characters. nmust be a value from 1 through 8,000.Storage size is the actual length of thedata entered, not n bytes.Nvarchar(n)Variable-length Unicode character dataof n characters. n must be a value from1 through 4,000. Storage size, in bytes,is two times the number of charactersentered.

Page 60: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler input

Modeler User's Guide4-26

NUMBER DatatypeThe NUMBER datatype stores fixedand floating-point numbers. Numbersof virtually any magnitude can bestored and are guaranteed portableamong various systems operatingOracle, up to 38 digits of precision. Thefollowing numbers can be stored in aNUMBER column:positive numbers in the range 1 x 10^-130 to 9.99..9 x 10^125 (with up to 38significant digits)negative numbers from -1 x 10^-130 to9.99..99 x 10^125 (with up to 38significant digits)zeropositive and negative infinity(generated only in import from aVersion 5 database)Note : Scale can be NEGATIVE

Decimal DatatypeDecimal[(p[, s])] and numeric[(p[, s])]Fixed precision and scale numbers.When maximum precision is used,valid values are from - 10^38 -1through 10^38 - 1.p (precision)Specifies the maximum total number ofdecimal digits that can be stored, bothto the left and to the right of thedecimal point. The precision must be avalue from 1 through the maximumprecision. The maximum precision is28 unless the server is started with the/p parameter of sqlservr. If the /pparameter is specified, the maximumprecision is 38; therefore, 0 < p <=38.s (scale)Specifies the maximum number ofdecimal digits that can be stored to theright of the decimal point. Scale mustbe a value from 0 through p. Thedefault scale is 0; therefore, 0 <= s <=p. Maximum storage sizes vary, basedon the precision.NOTE : Scale cannot be NEGATIVE

Date DatatypeThe DATE datatype stores point-in-time values (dates and times) in atable. The DATE datatype stores theyear (including the century), the month,the day, the hours, the minutes, andthe seconds (after midnight). Oraclecan store dates ranging from Jan 1,4712 BC through Dec 31, 4712 AD.Unless you specifically specify BC, ADdate entries are the default.

Date DatatypedatetimeDate and time data from January 1,1753, to December 31, 9999, to anaccuracy of one three-hundredthsecond, or 3.33 milliseconds. Valuesare rounded to increments of .000,.003, or .007 milliseconds.SmalldatetimeDate and time data from January 1,1900, through June 6, 2079, withaccuracy to the minute.

Page 61: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide5-1

Various transformations can be performed during the execution of an ETLprocess. These transformations perform actions such as:

� Add extra fields, for example, description fields for enumerated values� Join tables.� Balance parent-child tree structures.� Create views based on data warehouse tables.

The ETL Modeler folder list contains the following four folders related totransformation:

� Steps.� Computed steps.� SQL statements.� Intermediate tables.

StepsYou can use steps for the following types of actions:

���� Field transformations.String concatenation, arithmetic expressions and logical operations, fillingenumerated descriptions, and so on.

���� Denormalization.You can select multiple upload tables in one step and join the tables, which iscalled denormalization. Denormalization is recommended for dimensiontables.

The result of a step is stored in an intermediate table.

5 Transformation

Page 62: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-2

To create a stepTo create a step, take the following steps:

1 Select the Steps folder with the right mouse-button and click Add New onthe shortcut menu. The Join and Transform dialog starts.

2 Subsequently, include the desired table(s) in the step: Use the right mousebutton to select a table from the tree view in the left pane of the ETL Modelerwindow and start the Add to Step command (see Figure 35).

Figure 35 Including a table in a step

The selected tables are displayed in the lowest part of the Join and Transformdialog box. You can select tables from the following folders:

� Baan Tables.� Enumerates.� Text files.� Data source tables.� Intermediate tables.

An intermediate table contains the result of a step. You can include such anintermediate table in another step. Therefore, the result of the first step is inputfor a second step.

Page 63: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-3

The following figure shows the Join and Transform dialog box.

Figure 36 Join and Transform dialog box

Use this dialog to:

� Select .the desired table fields.� Join the upload tables.� Define transformations.� Save the result of the step in an intermediate table.

Page 64: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-4

Upper part of the Join and Transform dialog box

Use the upper part of the Join and Transform dialog to define the basicsettings:

���� Step Name.The name of the step. Naming convention: the name must start with TR_,followed by the module the step belongs to. The abbreviation TR stands forTransformation.

TR_COM_COMPANIESTR_FIN_ACTUALSTR_PUR_HISTORY

���� Use Group By.Select this check box to count or aggregate records to a particular group level,for example, the number of items by item group. You can specify the grouplevel in the Group By form tab.

���� Index.Use this button to define an index.

Figure 37 Index dialog box

Points of attention:

− Define a unique primary key if the contents of the upload table aretransferred directly to a data warehouse table. In this way, you can avoidduplicate records.

EXAMPLES

Page 65: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-5

− Define indexes if the transformation table must be joined, in another step,with some other tables. In this case, the indexes must contain the fieldsthat are used in the joins. This increases the performance.

− The upload table usually contains data from multiple Baan companynumbers. Therefore, include the LogComp field in every index.

���� Check.If you click this button, the ETL Modeler checks the structure of theintermediate result table. Every field name must be unique, spaces are notaccepted in field names, and so on.

Lower part of the Join and Transform dialog box

The lowest part of the Join and Transform dialog box consists of the followingfour form tabs:

� Transformations.Use this tab to select the fields, join upload tables, transform fields, and soon.

� Group By.Use this field to count or aggregate records to a particular group level, forexample, the number of items by item group.

� Filter.You can define a filter to select only a subset of the records in the uploadtables, for example, only select financial periods where the period type equalsthree or only select customers where the country code equals NL.

� Settings.Use this tab to specify the name of the intermediate table, in which the finalresult of the step is stored.

Page 66: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-6

Transformations form tab

Figure 38 Transformations form tab

The lowest part of this form tab displays the selected tables. To select a fieldfrom a table, you must double-click the field. To select all fields of a table atonce, you must double-click All Columns on the first line in a table. Theselected fields appear in the upper part of the window. If required, to create extraown fields, click the + button. To delete fields, click the X button.

Page 67: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-7

To join two tables, take the following steps:

� Select a field to be joined in the first table.

� Drag the mouse pointer to the related field in the other table.

� Repeat this procedure for every field that must be included in the join.

� Select a join with the right mouse-button to define the join type. Thefollowing menu appears:

Figure 39 To define join types

You can define the following join types:

� Select all records from the left table. This join is a left outer join.

.� Select all records from the right table. This join is a right outer join.

� Select all records from both tables. This join is a full outer join.

� If you do not select any option from the menu in the previous figure, an innerjoin is generated. This join type selects only those records, from both tables,for which the joined fields contain the same values. Records that do not havea matching record in the other table are ignored.

Page 68: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-8

Usually, you must select all records from the main table, which delivers themajor input to the result table. The records of this main table are extended withfields from the other table and finally saved in the result table.

The previous figure shows two tables: UP_COM_COMPANIES (main table) andTR_COM_ADDRESSES.The Address Code fields of both tables are joined with each other.

The Join type is Select All From UP_COM_COMPANIES. The join reads every recordin the UP_COM_COMPANIES table and adds address fields, such as Name, Address andCity. If a record cannot be joined, the Name, Address and City fields get a NULL value.The resulting records are saved in a transformation result tableTR_COM_COMPANIES.

If the joined tables are based on BaanERP tables, the LogComp field must beincluded in every join.

The upper part of this form tab displays the selected fields.

� Expression.By default, the Expression field contains the field code, for example,UP_COM_COMPANIES.Company. If required, you can define a fieldtransformation, such as:

− A string concatenation.− An arithmetic expression.− A logical operation.− Filling an enumerated description field.

You can create expressions through the Expression Builder. You can start theExpression Builder from the Expression field. For details on how to createexpressions, refer to �To use the Expression Builder� in this chapter.

� Name.A descriptive field name, used in the upload table in SQL Server.

� DB Type.The SQL Server data type of the field. You can select one of the followingdata types from a drop down list:

− Binary− Bit− Char− Datetime− Decimal− Enumerated− Float− Image

EXAMPLE

NOTE

Page 69: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-9

− Int− Money− Nchar− Ntext− Numeric− Nvarchar− Real− Smalldatetime− Smallint− Smallmoney− Text− Timestamp− Tinyint− Uniqueidentifier− Varbinary− Varchar

� Length.The length of the field.

� Precision.The total number of digits in a numeric value.

� Scale.The number of digits after the decimal sign in a numeric value.

� Null Value.The value that will be applied if the field contains a zero. Values foralphanumeric fields (string fields) and date fields must be enclosed by doublequotes.

If you do not specify a zero value, the following defaults are applied:

− For empty numeric fields: 0.− For empty alphanumeric fields: Underscores (__). The number of

underscores equals the field length.− For empty date fields: 18000101.

� Description.A brief field description.

You can define the null value expression through the Expression Builder. Youcan start the Expression Builder from the Null Value field. For details about howto create expressions, refer to �To use the Expression Builder� in this chapter.

Page 70: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-10

Group By form tab

Use the Group By form tab to define the field(s) that are used to group therecords.

Figure 40 Group By form tab

� Group By Part.The field by which the records are grouped. You can use grouping incombination with functions such as count, sum, and average. You can definemultiple Group By Parts.

Page 71: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-11

� Description.A brief description of the field.

You want to count the number of Employees by Department and Logical Company. First,create a new step and add the Employees table to it. Select the Group By check box in theTransformations form tab. Select the Employee, Department and LogComp fields.Define a count function on the Employee field. Finally, insert the Department andLogComp fields in the Group By form tab.

The structure of the result is similar to the content of the following table:Number of Employees by Department and Logical CompanyLogical Company Department Number of Employees100 ABC 25100 DEF 30100 GHI 40200 JKL 15200 MNO 55

Filter form tab

Use this form tab to select only a subset of the records in the input table.

Figure 41 The Filter form tab

EXAMPLE

Page 72: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-12

Enter the filter text in the upper pane of this form tab. The filter text must consistof Microsoft SQL syntax and is used as a where-clause to the query that isgenerated by the step.

See the previous figure.The input table for the TR_COM_TAX_PERIODS1 step isTR_COM_FINANCE_PERIODS. This table contains financial periods of variousPeriodTypes.The result table of this step is TR_COM_TAX_PERIODS1.The step contains the following filter text: TR_COM_FINANCE_PERIODS.PeriodType= 3 OR TR_COM_FINANCE_PERIODS.PeriodType = 0

Because of this filter, the result table will only contain financial periods whosePeriodType equals 3 or 0.

Settings form tab

Use this form tab to specify the name of the result table, in which the results ofthis step are stored.

Figure 42 Settings form tab

EXAMPLE

Page 73: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-13

You can store the result of the step in the following two types of intermediatetables:

� New intermediate table.� Existing intermediate table.

The result of the step is inserted in a table that contains the output of anotherstep. In this way you can merge the results of two steps.

The name of an intermediate table usually starts with TR. This is a namingconvention. The abbreviation TR stands for transformation.

Intermediate tables, which contain a final result, are added to the data warehouse.However, you can also add an intermediate table to another step. In that case, theresult table of a step is input for another step.

The steps TR_COM_TAX_PERIODS1 and TR_COM_TAX_PERIODS_ZERO in theB5CCOM20 ETL model store their output in the same intermediate table:TR_COM_TAX_PERIODS1This intermediate table is used as input table for the TR_COM_TAX_PERIODS step. Theresult of this step is stored in the TR_COM_TAX_PERIODS intermediate table.

To use the Expression BuilderYou can use the Expression Builder to define field transformations and nullvalues. In the Expression Builder, you can enter arithmetic expressions, logicalexpressions, string operations, and so on.

Creating an expression

You can start the Expression Builder from the following fields in theTransformations form tab of the Join and Transform window:

� Expression� Null Value

Start the Expression Builder in the following way:

1 Click on the desired field, Expression or Null Value. A � button appears atthe end of the field.

EXAMPLES

Page 74: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-14

2 Click the � button. Now, the Expression Builder window appears.

Figure 43 Expression Builder window with sample expression

Fields and Panes

The Expression Builder window contains the following fields and panes:

� Tables.Use this field to select a table from which you want to use a column. Thecolumns of this table are displayed in the Columns pane.

� Columns.You can select the desire columns from this pane. If you double-click, youcan add the selected column to the expression in the lowest pane.

� Function Group.You can select one of the following groups:

− All Functions.− String Manipulation.− Date Conversion.− Functions.− Aggregations.

The functions of the selected group are displayed in the Functions pane.

Page 75: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-15

� Functions.Use this pane to select the desired function. The following functions areavailable:

− Ucase.− Lcase.− Substring.− Left.− Right.− BaanDate.− Now.− Round.− IIF.− EnumValues.

BaanDate and EnumValues are Baan-specific VB Script functions, which arediscussed in �VB Script Functions,� in this chapter. The other functions areregular VB script functions. For information about these functions, refer tothe MSDN (Microsoft Developers Network) help.

� Operator Group.You can select one of the following Operator Groups:

− All Operators− Numeric comparison− Boolean− String− Numeric− Brackets− Aggregate

The operators of the selected group are displayed in the Operators pane.

� Operators.In this pane, you can select the desired operator.

OperatorsOperator Group OperatorsNumeric comparison <, <=, >, >=, =, <>Boolean AND, OR, NOTString & (Concatenation)Numeric +, *, -, /Brackets (, )

Page 76: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-16

� Expression.Enter the expression syntax in this pane. You can enter the expression bytyping, or by double clicking fields, functions and operators from the otherpanes. You must use VB Script syntax. Refer to the MSDN (MicrosoftDevelopers Network) help for details about VB Script.

Numeric and decimal fields can cause problems in Microsoft DTS. To preventthese types of problems, use the cdbl (convert to double) function for everynumeric and decimal field. This function converts numeric and decimal values tothe double data type. The resulting double values are not saved physically, butinstead are only stored in memory, where the values can be used in calculations,formulas, and so on.Syntax: cdbl<Field Name>.

To check the syntax of an Expression

To check the syntax of an expression, take the following steps:

1 Save and close the expression by clicking the OK button in the ExpressionBuilder.

2 Click the Check button in the Join and Transform window. The check isalso performed if you click the OK button to save and close the step.

If the expression syntax is incorrect, an error message appears. See the followingfigure for an example:

Figure 44 Sample Error Message

Sample expressionsTransform an alphanumeric field to uppercase:Ucase(UP_COM_Countries.description)

Null value for the Name field in the Employee table. If the Name field is empty, the fieldit is filled with the corresponding Employee code:"Empty Name, Employee code =” UP_COM_EMPLOYEES.employee

Retrieving the description of an enumerated field:EnumValues(UP_COM_EMPLOYEES.civil_status,"tcphc.cist")

NOTE

EXAMPLES

Page 77: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-17

For more details, refer to the following section.

VB Script Functions� BaanDate.

Use this function to convert alphanumeric fields that contain a date in theYYYYMMDD format, to the SQL Server datetime data type,MM/DD/YYYY format.

Syntax: BaanDate(<fieldname>)

The upload table UP_AK_EMPLOYEES contains a date_of_birth field. This field isan alphanumeric field, data type char. You can transform this field to a date field, datatype datetime:In the Transformations form tab of the Join and Transform window, change thedata type of the field to datetime. Subsequently, start the Expression Builder and enterthe following syntax:

BaanDate(UP_AK_EMPLOYEES.date_of_birth)

� EnumValues.Use this function to retrieve the description belonging to an enumeratedvalue. The enumerated values and the corresponding descriptions are storedin the ETL Modeler�s Baan dictionary.

Syntax: EnumValues(<enumerated field>, �domain�)

The upload table UP_AK_EMPLOYEES contains the enumerated civil_status field.This field belongs to the Baan domain tcphc.cist, Civil Status). This domain containsthe following enumerated values:Civil Status - tcphc.cist domainEnumerated value Description1 Single2 Married3 Divorced4 Not Applicable

You can retrieve the enum description in the following way:Insert a new field, civil_status_desc, in the Transformations form tab of the Join andTransform window. The data type of the new field is char. Use the arrow button tomove the field directly below the civil_status field. Now, start the Expression Builderon the new civil_status_desc field and enter the following expression:

EnumValues(UP_AK_EMPLOYEES.civil_status,"tcphc.cist")This expression uses the enum value in the civil_status field to retrieve thecorresponding description. So, if the civil_status field contains the value 2, thecivil_status_desc field is filled with �Married�.

EXAMPLE

EXAMPLE

Page 78: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-18

� IIF.Inside If. Use this function to fill a field with a value, which depends on theresult of a logical expression.

Syntax: IIF (logical expression, return-expression A, return-expression B).

If the specified logical expression is true, the IIF statement returns expressionA. If the logical expression is false, expression B is returned.

The Finance ETL model contains the TR_FIN_ACTUAL_BUDGETS11 step. Thefollowing expression is linked to the ActualFinalBudget field in this step:

IIF(TR_FIN_FACT_ACCTBAL_FSC.FinalBudget = 1 ,1 ,0 )

The IIF statement returns 1 if the FinalBudget field equals 1. Therefore the fieldActualFinalBudget field is filled with 1.The IIF statement returns 0 if the final budget field contains a value different from 1,so the ActualFinalBudget field is filled with 0.

Avoid Return-expressions, which contain a potential division by zero. Forexample, IIF(a = b, x, 1/y). A zero division generates an error during theevaluation of the IIF statement, even before the execution of the division.However, the Microsoft DTS packages ignore this error and do not generate anerror message or warning. This situation is undesirable, because you mightupload corrupted data without noticing.The IIF statement always calculates both return-expressions, regardless of theresult of the logical expression , a=b. As a result, even if A equals B, the secondreturn-expression, 1/y, is calculated. This results in the problems mentioned, if yequals 0.

Computed stepsComputed steps perform balance actions and cleanup actions in tree structures,such as general ledger accounts, budgets, and projects. Computed steps are usedin the standard Finance and Project ETL models. Various Baan Finance andBaan Project tables contain records wit a parent-child relationship. An example isthe Baan Finance General ledger Accounts table. A Parent Ledger Account canconsist of various child Ledger Accounts. Parent-child relationships also occur inBudgets, Financial Dimensions, Projects, and so on. The computed steps cleanand balance this type of parent-child structures. Normal steps cannot handle theseactions because of the complexity of the parent-child structures. Two computedstep types exist:

� CleanupTree.� Ragged2Balanced.

EXAMPLE

NOTE

Page 79: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-19

CleanupTreeCleanupTree performs correction and cleanup actions in a parent-child structure.You can run CleanupTree before Ragged2Balanced starts. However, this step isnot mandatory. If you run CleanupTree immediately before Ragged2Balanced,the resulting table of CleanupTree functions as the input table forRagged2Balanced.

CleanupTree performs the following actions:

� Defines a type for parent records.� Runs a cleanup action.

This concept is explained through an example based on Ledger Accounts. Theexplained principle also applies to the other parent-child structures, such asBudgets, Projects, and so on.

Consider the following parent-child relation:

Parent-Child RelationshipLedger Account Parent Ledger Account12 13 14 35 36 57 5

This table provides the following information:

� Ledger accounts 1, 3, and 5 are parents.� Ledger accounts 2, 3, 4, 5, 6, and 7 are children.� Ledger Account 1 is the parent of ledger accounts 2 and 3.� Ledger Account 3 is the parent of ledger accounts 4 and 5.� Ledger Account 5 is the parent of ledger accounts 6 and 7.

Page 80: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-20

To define a type for parent records

To analyze the Ledger Account records in the previous table through MicrosoftOLAP Services, every Ledger Account must be assigned to a type. As a result, aGeneral Ledger Accounts table always contains a Type column. This typeindicates to which side of the balance, debit or credit, the ledger account belongs.An example of a Type column is the Account_Type column in theTR_FIN_GL_ACCOUNTS1 table.

In the data warehouse and Microsoft OLAP Services, the Type column must befilled in for every ledger account.

In exceptional cases, the Type column of some parent ledger accounts exportedfrom BaanERP can be empty. Therefore, some records might not be assigned to atype. These records cause problems in the OLAP analysis.

To solve this problem, CleanupTree finds all parent records with an empty Typecolumn. Subsequently, CleanupTree fills the Type column with the type of acorresponding child record.

The Account_type column for Ledger Account 1 is empty. The Account_Type for bothchild Ledger Accounts 2 and 3 is Balance Sheet.CleanupTree fills the Account_Type column of Ledger Account 1 with Balance Sheet.

Cleanup action

After filling empty Account_Type columns, ledger accounts can still exist thatare not assigned to an Account_Type. This applies to ledger accounts that do nothave any child accounts. The Account_Type column of such an account cannotbe filled in with the value of a child. Therefore, the Account_type column is stillempty.

CleanupTree performs one of the following actions if records with an emptyAccount_Type column are found:

� Abort.The CleanupTree process stops.

� Ignore.CleanupTree does not perform any action on records with an emptyAccount_Type column.

� Remove.CleanupTree removes records with an empty Account_Type column. This isthe default setting.

EXAMPLE

Page 81: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-21

To define a CleanupTree computed step

The following figure shows a sample CleanupTree action in the Finance ETLmodel:

Figure 45 CleanupTree in a computed step

Important fields

The Computed Step dialog box contains the following important fields:

� Computed Step Name.The name of the computed step. Usually, a TR_ prefix and a _CLEANUPsuffix are used. Refer to the previous figure.

� Computed Step Type.CleanupTree

� Input Table.The table from which the computed step reads input. You can select the inputtable from a pull down list.

� Result table.The table in which the result of the step is stored.

Page 82: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-22

� A single column/Two columns.In most tables, records are unique for each company number. For these tables,you must specify only one parent-child relationship. In some tables, however,records are not unique for each company. For those tables, an extra column isused to uniquely identify a record. You must specify two parent-childrelationships for this type of tables. For more information, refer to theexample at the end of this section.

� Child Column(s).The name of the child column(s), for example GLAccount or Budget.

� Parent Column(s).The name of the parent column, for example, Parent_Account orparent_budget.

� Description Column.The column, which contains the description of the child records, for example,GLAccount_Description or budget_description.

� Context column.Records are only unique in a particular context. The context for Baan datawarehouse tables is the logical company number. Therefore, the LogCompfield is always entered here.

� CleanUp Options.The cleanup action to be performed on records with an empty Type column:Abort, Ignore, Remove.

� Type Column.Indicates to which side of the balance, debit or credit, the record belongs. Forexample: Account_Type.

General Ledger Accounts are unique in a company number. You must specify only oneparent-child relationship:Select the A Single Column option and define a relationship between the Parent_Accountand GLAccount columns.

In the Actual Budgets table, records are not unique in a company number: actual budgetsare unique per company number and year.This table can contain records such as:

Actual BudgetsActual Budget Code Company YearA 100 1999A 100 2000

In this situation, you must specify two parent-child relationships:

EXAMPLES

Page 83: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-23

Select the Two Columns option and define parent-child relationships between thefollowing columns:� Parent Budget - Budget� Parent Budget Year - Yr

Ragged2BalancedRagged2Balanced is usually run after CleanupTree. Ragged2Balanced performsbalancing actions in parent-child tree structures, and changes ragged trees intobalanced trees.

Ragged trees

This concept is explained through an example based on ledger accounts. Theexplained principle also applies to the other parent-child structures, such asBudgets, Projects, and so on.

Consider the parent-child relationship for the following ledger accounts:

Parent-Child RelationshipLedger Account Parent Ledger Account12 13 14 35 36 57 5

Page 84: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-24

The following figure shows the parent-child relationship for the same ledgeraccounts in a tree structure:

Figure 46 Ragged tree structure

This tree structure is ragged. A ragged tree is a tree in which elements of thesame level have a different number of levels below:

� Ledger Account 2 contains just one level: Level 2.� Ledger account 3 contains three levels:

− Level 2: Ledger Account 3.− Level 3: Ledger Accounts 4 and 5.− Level 4: Ledger Accounts 6 and 7.

Ragged trees occur in the standard Finance and Project ETL models. Someexamples of ragged tree structures include:

� Ledger accounts.� Budgets.� Projects.� Financial dimensions.

Page 85: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-25

Ragged trees cause problems in OLAP analysis, especially if you want to totalizedata. The Baan OLAP Client always calculates totals from the lowest tree level.For ragged trees, this lowest level is missing for some of the parent records. Thevalues stored in these missing levels are not included in the calculated total. Sothe final result turns out too low.

Refer to the previous figure: You want to see the total amount of Ledger Account 1. TheOLAP Client calculates the total from the lowest tree level: level 4. Level 4 only containsthe Ledger Accounts 6 and 7, so the calculated total is 5000 + 8000. The final result is acalculated total of 13000 for Ledger Account 1.This is not correct, because the amounts of Ledger Accounts 2 and 4, 30000 and 7000,should be included as well.

To balance ragged treesTo solve this problem, the Ragged2Balanced computed step inserts dummyelements (see Figure 47). The dummy elements are shaded.

Figure 47 Balanced tree structure

Ragged2Balanced performs the following actions:

� Adds a dummy element for each missing level. As a result, the lowest level isnow available for all elements in the tree, therefore, the tree is balanced. Eachdummy level is filled in with the amount of the corresponding parent. Thissolves the problems regarding the calculation of totals. See also the followingexample.

EXAMPLE

Page 86: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-26

� Adds a �?� prefix to all dummy levels. Because of this �?� prefix, the OLAPClient will hide the dummy levels.

� Adds a � � prefix to the existing normal levels. The OLAP Client treats theselevels in a normal way. The levels are not hidden, therefore, you can expandthe levels and so on.

Refer to Figure 47. You want to see the total amount of Ledger Account 1. TheOLAP Client calculates the total from the lowest tree level: level 4. Level 4contains the following Ledger Accounts:

Ledger AccountsLedger Account AmountDummy 1 30000Dummy 2 70006 50007 8000

Totalizing Ledger Account 1 now results in the correct amount: 30000 + 7000 +5000 + 8000 = 50000.

To define a Ragged2Balanced computed step

The following figure shows a sample Ragged2Balanced action in the FinanceETL model.

Figure 48 Ragged2Balanced in a computed step

EXAMPLE

Page 87: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-27

Important fields

The Computed Step dialog box contains the following important fields:

� Computed Step Name.The name of the computed step. Usually, a TR_ prefix and an _R2B suffixare used. See the previous figure.

� Computed StepType.#Select Ragged2Balanced from the pull down list.

� Input Table.The table from which the Ragged2Balanced reads its input. You can selectthe input table from a pull down list.

� Result table.The table in which the result of the step is stored, for example,TR_FIN_GL_ACCOUNTS_R2B.

� A single column/Two columns.In most tables, records are unique for each company number. For these tables,you must specify only one parent-child relationship. In some tables, however,records are not unique for each company. As a result, for those tables, anextra column is used to uniquely identify a record. You must specify twoparent-child relationships for this type of tables. See the example at the end ofthe �CleanupTree� section.

� Child Column(s).The name of the child column(s), for example, GLAccount or Budget.

� Parent Column(s).The name of the parent column, for example, Parent_Account orparent_budget.

� Description Column.The column that contains the description of the child records, for example,GLAccount_Description or budget_description.

� Context column.Records are only unique in a particular context. The context for BaanERPdata warehouse tables is the logical company number. Therefore, theLogComp field is always entered here.

Page 88: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-28

� Number of Levels.The number of levels for which you want to generate dummies. This valuemust equal the maximum number of levels used in the specified table.

The table TR_FIN_GL_ACCOUNTS_CLEANUP is the input table for aRagged2Balanced action. This table contains Ledger Accounts, which consist of 1level, 2 levels, 3 levels and 4 levels.The OLAP Client calculates totals based on the lowest level. Therefore, you mustgenerate dummies for four levels.

� Include parent.Select this check box to store all records, parents and children, from theragged tree structure in the result table. If you clear this check box, parentrecords are not included in the result table.

Consider the following Ledger Accounts:Parent-Child RelationshipLedger Account Parent Ledger Account12 13 14 35 36 57 5If you select the Include parent check box, all Ledger Accounts are stored in theresult table.If you do not select the Include parent check box, the Ledger Accounts 1, 3 and 5 arenot included in the result table. The result table only contains the Ledger Accounts 2,4, 6 and 7.

SQL statements SQL statements can perform finishing processes that are activated afterinitializing or loading the data warehouse. The standard ETL models containvarious SQL statements, which perform actions such as:

� Create data warehouse table.� Create views based on data warehouse tables.� Insert records in data warehouse tables.� Delete records from data warehouse tables.

The SQL statement PUR_SUMORDERLINEQTY is run after the initialization of the datawarehouse. It creates a view which calculates the order line quantity. The order linequantity equals the sum of the intake quantity minus the sum of the cancelled quantity.

EXAMPLE

EXAMPLE

EXAMPLE

Page 89: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-29

To create SQL statementsTo create an SQL statement, take the following steps:

Right-click the SQL Statements folder in your ETL model, and click Add Newon the shortcut menu. Now, the SQL Statement dialog appears.

Figure 49 SQL Statement window

Use the upper part of this dialog to specify basic information such as the nameand type of the SQL statement. The lower part of the dialog consists of thefollowing two form tabs:

� SQL statements.Here you can type the syntax of the SQL statement. Use Microsoft SQL 7.0syntax.

� Run After.Important if your ETL model contains multiple SQL statements. You candetermine the run order here. See the following section.

Page 90: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-30

Important fields

The SQL Statement Window contains the following important fields:

� Name of SQL statement.Type the name of the SQL statement here. Use descriptive names.

PUR_DELETE_ORDERLINES_FINALINV_MONTH_VALUESCOM_FINANCE_PERIODS

An SQL statement must have the same name as the view / table the SQLstatement creates.

� Type.The Type indicates at which moment the SQL statement must run. You canselect the following types:

−−−− Run after Init. The SQL statement is run after the initialization of the datawarehouse, when the <ETL Model>_init DTS package creates emptytables in the data warehouse. This is useful for one-time actions, which donot require data. For details about DTS packages, refer to the BaanBISDecision Manager 2.0 Administrator�s Guide (U7563A US).

Creating an extra tableDefining a view.

− Run this type of one-time actions after Init, rather than run aftertransformation or after Load DW. This saves time during the regularupload of the data warehouse.

−−−− Run after Load DW.The SQL statement runs after every upload of the data warehouse. <ETLModel>_LoadDW is the name of a DTS package. For details about DTSpackages, refer to the BaanBIS Decision Manager 2.0 Administrator�sGuide (U7563A US).

Some of the standard ETL models use a SQL statement of type Run after Load DWto store the final result of a view in a table, after every upload of the data warehouse.This results in a faster access to the data: a table offers direct access to its data, while aview provides indirect access. A view reads its data from a table or from another view.

−−−− Run after Transformation.The SQL statement runs when the transformations are completed, whichis after the <ETL Model>_JoinInStaging DTS package has run. This isjust before the upload to the data warehouse starts. For details about DTSpackages, refer to the BaanBIS Decision Manager 2.0 Administrator�sGuide (U7563A US).

EXAMPLE

NOTE

EXAMPLE

EXAMPLE

Page 91: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-31

� Create Single Company Views.A single company view is a filter, which uses the LogComp field to showonly records from one Baan company number. If you select this check box, asingle company view is generated for every company number you exporteddata from.

The SQL statement DW_PUR_ORDERLINES_FINAL contains the syntax forcreating a table DW_PUR_ORDERLINES_FINAL. The Create Single CompanyViews check box is selected.This SQL statement creates the following if you export data from the Baan companynumbers 100, 200 and 300:

A data warehouse table DW_PUR_ORDERLINES_FINAL, containing records ofcompanies 100, 200 and 300A view DW_PUR_ORDERLINES_FINAL_100, which shows only records ofcompany 100A view DW_PUR_ORDERLINES_FINAL_200, which shows only records ofcompany 200A view DW_PUR_ORDERLINES_FINAL_300, which shows only records ofcompany 300

EXAMPLE

Page 92: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-32

Use the Run After form tab to determine the order in which the SQL statementsare run. You can select an SQL statement and specify after which other SQLstatement it must run.

Figure 50 Run after Form tab

The PUR_TRANSTIME SQL statement in the previous figure runs after thePUR_TRANSDATE SQL statement. The order of execution is important if anSQL statement is based on the result of another statement.

The PUR_TRANSDATE SQL statement creates a view, which shows the latesttransaction date for every purchase order line. This view is based on the existing purchasehistory table in the data warehouse, DW_PUR_HISTORY.

The PUR_TRANSTIME SQL statement creates a view, which shows the latest transactiontime for every purchase order line. This view reads information from thePUR_TRANSDATE view and must therefore be run after the PUR_TRANSDATE SQLstatement. See the Run After form tab in the previous figure.

EXAMPLE

Page 93: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-33

Sample SQL statementThis section contains the syntax of the PUR_QUANTITY SQL statement in thePurchase ETL model.

PUR_QUANTITY

The PUR_QUANTITY SQL statement contains the following syntax:

Create VIEW PUR_QUANTITY AS

SELECT

Order_Date_Prefix, Ordernumber, PositionNr, LogComp,

CASE WHEN RecordType = 3 and Order_Type = 1 and

Actual_Receipt_Date < Promised_Receipt_Date THEN

Approved_Qty_Inv

ELSE

0

END AS EarlyQuantity,

CASE WHEN RecordType = 3 and Order_Type = 1 and

Actual_Receipt_Date = Promised_Receipt_Date THEN

Approved_Qty_Inv

ELSE

0

END AS OnTimeQuantity,

CASE WHEN RecordType = 3 and Order_Type = 1 and

Actual_Receipt_Date > Promised_Receipt_Date THEN

Approved_Qty_Inv

ELSE

0

END AS LateQuantity

FROM PUR_PROMISED_DATE

Page 94: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Transformation

Modeler User's Guide5-34

Intermediate tablesYou can use intermediate tables to store the results of a transformation step or theresults of a computed step. To define an intermediate table, you must define andsave a new (computed) step. To change an intermediate table, you must modifythe corresponding (computed) step. For details, refer to �Steps� and �ComputedSteps� in this chapter.

Several types of intermediate tables exist:

� Intermediate tables that are the final result of one or more (computed) steps.The contents of such tables must be imported in a data warehouse table. Tolink an intermediate table to a data warehouse table, take the following steps:

− Select the intermediate table with the right mouse-button.− Click Add to Data warehouse on the shortcut menu.

� Intermediate tables that are used as input for another transformation step. Toinclude an intermediate table in a step, take the following steps:

− Open the step.− Right-click the intermediate table.− Click Add to Step on the shortcut menu.

� Intermediate tables, which are used as input for another computed step. Forexample: the result table of a CleanupTree computed step is input for aRagged2Balanced computed step. Perform the following to include anintermediate table in a computed step:

− Define a new computed step.− In the Input Table field, select the intermediate table from the pull down

list.

Page 95: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide6-1

The final output of an ETL model is stored in the data warehouse. The ETLModeler folder list contains the following two folders related to this output:

� Data warehouse tables.Here you can specify the structure of the final data warehouse tables in whichthe output of the ETL process is stored.

� Star schemas.In a star schema, you can define the relationship between a data warehousefact table and the relevant data warehouse dimension tables.

Data warehouse tablesAfter the ETL process uploads and transforms the data in the staging area, theETL process will save the final output in data warehouse tables. You can definedata warehouse tables based on the following:

� An upload table.If you do not want to perform any transformations, you can define a datawarehouse table directly based on an upload table. Upload tables can containthe contents of:

− Baan tables.− Enumerates.− Text files.− DataSource tables.

� An intermediate table.Intermediate tables can contain the result of:

− A step.− A computed step.

You can define the following three types of data warehouse tables:

� Fact tables.� Dimension tables.� Slow moving dimension tables.

These types are each discussed in the following sections.

6 ETL Modeler output

Page 96: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-2

Fact tablesA fact table contains the numeric data to be analyzed: the transaction records.These data correspond to the measures of an OLAP cube. Typical measures arecost, sales, and budget data. In Microsoft OLAP, this type of measures isanalyzed against the various dimension categories of a cube.

Some examples of fact tables in the standard BaanBIS Decision Manager 2.0templates are:

Sample Fact tablesFact table DescriptionDW_PUR_HISTORY Purchase HistoryDW_INV_GOODS_FLOW Inventory Goods FlowDW_INV_TRANSACTIONS Inventory TransactionsDW_INV_RPL_HISTORY Inventory Replenishment History

Dimension tablesDimension tables contain data that corresponds to the dimensions of an OLAPcube. These dimensions are distinct categories for analyzing business data. Themeasures in the cube, which originate from a fact table, are analyzed against thecube�s dimensions. Typical dimensions are time, customer, and itembreakdowns.

Some examples of dimension tables in the standard BaanBIS DecisionManager 2.0 templates are:

Sample dimension tablesDimension table DescriptionDW_INV_ORDER_ORIGINS Inventory Order OriginsDW_INV_ORDER_TYPES Inventory Order TypesDW_COM_FINANCE_PERIODS Finance PeriodsDW_EP_INVOICESTATES E-Procurement Invoice States

Page 97: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-3

If you change the contents of a record in a dimension table, the old values arereplaced by the new ones.

The Business Partners table in the data warehouse contains the following records:Business PartnersBusiness Partner Name State1001 A. Johnson Texas1002 B. Robinson Oregon1003 C. Jones California

Business Partner 1003 has moved to Florida. The State field for Business Partner 1003 ismodified in BaanERP. During the next upload, on 01-08-2000, into the data warehouse,the old records are overwritten by the new ones. After this upload, the Business Partnerstable in the data warehouse contains the following records:Business PartnersBusiness Partner Name State1001 A. Johnson Texas1002 B. Robinson Oregon1003 C. Jones Florida

This type of changes to a dimension record, can cause problems in OLAPanalysis. See the following example:

Suppose you view the Sales History by state. All sales figures for Business Partner 1003now come under Florida.This is not correct: only the sales figures after the move must come under Florida. Thesales figures before the move must come under California.In the current situation the displayed sales figures for Florida are too high, while thefigures for California are too low.

Slow moving dimension tables can solve this type of problems.

Slow moving dimension tablesThese tables contain the same type of data as normal dimension tables. Slowmoving dimension tables, however, keep a history of the changes to the records.If you change the contents of a record in a slow moving dimension table, the newvalues are stored in a new record. The old values are still available in the oldrecord.

Another term for slow moving dimension tables is �Slowly changing dimensiontables.�

EXAMPLE

NOTE

Page 98: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-4

Compared to a regular dimension table, a slow moving dimension table containsthe following additional columns:

� Surkey.Surrogate key. After a change, the table can contain two versions of the samerecord. For example, two records for Business Partner 1003. The old primarykey, Business Partner, is no longer unique. Still, records must be uniquelyidentified. Therefore, a surrogate key is added to the table definition. Thissurrogate key is defined as the primary key of the table.

� Start_date.This field contains the date of creation of the record. During the upload of anew record, the Start_date field is filled in with the upload date.

� End_date.The end date of the record. By default, this field is filled in with 31129999. Ifyou upload a modified version of a record into the data warehouse, a newrecord is created. At that moment, the End_date field for the old record isfilled in with the upload date.Start-date and End_date together define the period that the record shows theoperational situation.

� Is_current.This boolean field contains 1, true, in the newest version of a record. Forolder versions of the record, is_current equals 0, false.

Consider the following example:

The Business Partners table in the data warehouse contains the following records:

Business PartnersSurKey Business Partner Name State Start Date End Date Is Current1 1001 A. Johnson Texas 25022000 31129999 Y2 1002 B. Robinson Oregon 05011996 31129999 Y3 1003 C. Jones California 01011990 31129999 Y

Business Partner 1003 has moved to Florida. The State field for Business Partner 1003 ismodified in BaanERP. During the next upload into the data warehouse, on 01-08-2000, anew record is added for Business Partner 1003. After this upload, the Business Partnerstable in the data warehouse contains the following records:

Business PartnersSurKey Business Partner Name State Start Date End Date Is Current1 1001 A. Johnson Texas 25022000 31129999 Y2 1002 B. Robinson Oregon 05011996 31129999 Y3 1003 C. Jones California 01011990 01082000 N4 1003 C. Jones Florida 01082000 31129999 Y

Page 99: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-5

The table now contains 2 records for Business Partner 1003: Both have a differentsurrogate key. The surrogate key is used to uniquely identify the records.

The old version of the record is valid from 01-01-1990 until 01-08-2000. The new versionis valid from 01-08-2000 to 31-12-9999.

Suppose you view the Sales History by State in the OLAP client. The salesfigures for Business Partner 1003 are treated in the following way:

� Sales figures before 01-08-2000 are related to the old version of the customer1003 record. As a result, these figures come under the state California.

� Sales figures from 01-08-2000 are related to the new version of the customer1003 record. As a result, these figures come under the state Florida.

To define a data warehouse tableTo define a data warehouse table, take the following steps:

1 Right-click the desired upload table or intermediate table.

2 Click Add to Data warehouse on the shortcut menu, as shown in thefollowing figure (see Figure 51). The Data Warehouse Table dialog boxappears.

Figure 51 Adding a table to the data warehouse

Page 100: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-6

The following figure (see Figure 52) shows the Data Warehouse Table dialogbox.

Figure 52 Data Warehouse Table dialog box

Use this dialog to define the structure of the data warehouse table that must begenerated.

The upper part of the dialog contains basic information such as the name of thedata warehouse table. The lower part of the Data Warehouse Table dialogconsists of the following three form tabs:

� Table Definition.� Incremental.� Settings.

Page 101: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-7

Upper part of the Data Warehouse Table dialog box

Use the upper part of the dialog to specify the following:

���� Data warehouse Table Name.The name of the table that is generated in the data warehouse. As a namingconvention, a DW_ prefix is used, which stands for data warehouse.

Data warehouse tablesTable Name DescriptionDW_COM_EMPLOYEES EmployeesDW_FIN_GL_ACCOUNTS General Ledger AccountsDW_PUR_HISTORY Purchase History

���� Based on Table.The name of an upload table or an intermediate table in the staging area. Thistable functions as input for the data warehouse table. The data warehousetable is generated based on the content of this input table.

� Index.Use this button to start the Indexes dialog box, which is shown in thefollowing figure:

Figure 53 Indexes Dialog box

EXAMPLE

Page 102: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-8

In this dialog box, you can define the primary key and other indexes for the datawarehouse table. The primary key must be unique. In this way, duplicate recordsare prohibited. The primary key has the following structure:

� For fact tables and regular dimension tables, the primary key contains thefields from the primary key of the input table, which usually includes theprimary key of the original BaanERP table combined with the LogCompfield. The LogComp field is required because the data warehouse tablesinclude records from multiple BaanERP company numbers. Records areunique for each company number.

� For slow moving dimension tables, the primary key must contain only theSurkey field. This field uniquely identifies the records.

Table Definition form tab

Figure 54 Table Definition form tab

The Table Definition tab contains the following fields. All fields, except Handleand Historic, are display fields, and are read from the table definition of theinput table.

� Name.A descriptive field name.

Page 103: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-9

� DB Type.The SQL server data type of the field.

� Length.The length of the field.

� Precision.The total number of digits in a numeric value.

� Scale.The number of digits after the decimal sign in a numeric value.

� Handle.Handle numbers are only important if you use TopTier�s Baan DataNavigator to browse the data in your BaanERP system. The handle numbersspecified here are linked to the dimensions in Microsoft OLAP.

The TopTier software uses the handles to perform drag and relate actionsfrom the Baan OLAP Client to the Baan Data Navigator, and vice versa.

Specify handle numbers for primary keys and foreign keys only:

− The original primary key, as defined in the (BaanERP) source table. Forexample, the Area field in the Areas table, the Employee field in theEmployees table, and so on.

− Foreign keys: Fields that refer to other tables. For example, the Countryfield in the Employees table, the ItemGroup field in the Items table, andso on.

These key fields have their own unique handle numbers. For example, theEmployee field in the DW_COM_EMPLOYEES table has handle number110001005 (see Figure 54). Refer to the standard ETL Models for the correcthandle numbers.

For more details, refer to the documentation of the Baan Data Navigator.NOTE

Page 104: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-10

� Historic.This check box is only available in slow moving dimension tables. Thesetting of the Historic check box determines the way in which modifiedrecords are uploaded into the data warehouse. You must only set to historicthose fields that are important to keep a history on.

− If the content of a historic field has changed, a new record is added duringthe next upload. The old record is closed.

− If the content of a non-historic field has changed, the old values of therecord are overwritten during the next upload.

The State field in the Business Partners table is a historic field. This table contains thefollowing record:Business PartnersSurKey Business Partner Name State Start Date End Date Is Current3 1003 C. Jones California 01011990 31129999 Y

Business Partner 1003 has moved to Florida. The State field for Business Partner 1003 ismodified in BaanERP. During the next upload into the data warehouse, on 01-08-2000, anew record is added for Business Partner 1003. After this upload, the Business Partnerstable in the data warehouse contains the following records:

Business PartnersSurKey Business Partner Name State Start Date End Date Is Current3 1003 C. Jones California 01011990 01082000 N4 1003 C. Jones Florida 01082000 31129999 YThe table now contains two records for Business Partner 1003: Both have a differentsurrogate key. The surrogate key is used to uniquely identify the records.

The old version of the record is valid from 01-01-1990 until 01-08-2000. The new versionis valid from 01-08-2000 to 31-12-9999.

If the State field were a non-historic field, the old record would have been replaced by thenew one.

For more details about slow moving dimensions, refer to the BaanBIS DecisionManager 2.0 Administrator�s Guide (U7563A US).

� Description.A brief field description.

� Unset All Historic.If you click this button, all Historic check boxes are cleared.

EXAMPLE

NOTE

Page 105: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-11

Incremental form tab

Figure 55 Incremental form tab

This form tab is only available for fact tables. You can define a specialincremental update or delete SQL statements here. However, this procedure isonly necessary in exceptional cases, for example, when the data warehouse tablehas no primary key.

In the FIN_FACT_TRINT_FIN table, more than 16 columns are required to uniquelyidentify a record. SQL Server 7 allows a maximum of 16 columns per index. Therefore,this table has no primary key.Suppose you are uploading a set of records, belonging to a particular date range, for thesecond time. In a normal situation, SQL Server overwrites duplicate records during thistype of upload. It uses the table�s primary key to determine if a record is a duplicate.For this particular table however, there is no primary key. So, duplicate records are notrecognized and SQL Server will add all records during this second upload. TheFIN_FACTS_TRINT_FIN table contains many duplicate records after this second upload.To prevent these duplicates from occurring, an incremental delete action is run during theupload process. This action is defined in the Incremental form tab. See Figure 55.

EXAMPLE

Page 106: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-12

Settings form tab

Figure 56 Settings form tab

Use this form tab to specify basic information about the result table.

� Table Type.Select one of the following table types:

− Dimension.− Fact.− Dimension (Slow moving).

If you select Dimension (Slow moving), the ETL Modeler adds thefollowing fields to the data warehouse table definition:

− Surkey.− Start_date.− End_date.− is_current.

You must define the surkey field as the primary key and mark the relevantfields as Historic. For more information, refer to the previous sections in thischapter.

NOTE

Page 107: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-13

� Transaction Date.This field is only available for fact tables. Every fact table contains a field inwhich the transaction date is stored. Use the pulldown menu to select theTransaction Date field, here. The name of this date field can vary for eachtable. In most fact tables, the field name is TransactionDate.

Transaction date fields are used during the upload into the data warehouse.The transaction date of a fact record is compared to the start date and end dateof the corresponding slow moving dimension records. In this way, theuploaded fact records are linked to the correct version of the slow movingdimension record.

The Business Partners table contains 2 records for Business partner 1003:

Business PartnersSurKeyBusiness Partner Name State Start Date End Date Is Current3 1003 C. Jones California 01011990 01082000 N4 1003 C. Jones Florida 01082000 31129999 Y

Suppose the following data is uploaded to the Purchase Order History table:Purchase Order: 23501Business Partner: 1003Transaction date: 11-10-2000Order Amount: 20000,00

The transaction date is compared to the start date and end date of both Business Partner1003 records. The transaction date is 11-10-2000. Therefore the new Purchase OrderHistory record is linked the record with SurKey 4. During aggregations of PurchaseHistory figures by state, the figures of the new record will come under Florida.

The export process uses the transaction date fields. During the export of a facttable, you must specify a date range. This date range is always based on thetransaction date field in the fact table.

The name of the transaction date field for the FIN_FACTS_TRF_FIN table inthe Finance ETL model is TransactionDate.

� SlowMoving Effective Date.This list is only available for slow moving dimension tables. You can use thisfield to specify in which way the upload process can retrieve the slow movingeffective date. This date is used as:

− End date for the old version of a changed dimension record.− Start date for the new version of a changed dimension record.

In the Slow Moving Effective Date list, select one of the following options:

EXAMPLE

EXAMPLE

Page 108: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-14

� Baan Company File.Select this if the data warehouse table is based on data exported fromBaanERP. The BaanERP export sessions store the export date in the exportedfile. The upload process uses this export date as slow moving effective date.

� Generate ExportedDate.Use this if the data warehouse table is based on a non-BaanERP table. Forexample, a datasource table such as a Microsoft Access table, a SQL Servertable, and so on. In this situation, there is no export date. Therefore, theupload process uses the upload date as slow moving effective date.

Business partner 1003 has moved from California to Florida. The changed record isexported from BaanERP on 01-08-2000.

The upload process reads the slow moving effective date, 01-08-2000, from the exportfile. Subsequently:� 01-08-2000 is entered as end date for the old version of the record� 01-08-2000 is entered as start date for the new version of the record

Create Single Company Views. A single company view is a database viewusing a filter, which only shows records from one Baan company number. If youselect this check box, a single company view is generated in the data warehousefor every company number you exported data from. The name of a singlecompany view equals the name of the corresponding data warehouse tablefollowed by �_<company number>�

Example based on Employee data:

Data is exported from BaanERP companies 100, 200 and 300.Your data warehouse contains the following table and views:

A data warehouse table DW_COM_EMPLOYEES, containing records of companies 100,200 and 300A view DW_COM_EMPLOYEES_100, which shows only records of company 100A view DW_COM_EMPLOYEES_200, which shows only records of company 200A view DW_COM_EMPLOYEES_300, which shows only records of company 300

EXAMPLE

Page 109: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-15

Star schemasUse a star schema to define the relationship between a fact table and the relevantdimension tables.

The standard Inventory ETL model contains a star schema INV_HISTORY. In thisschema the Inventory-History fact table is linked to the Items, Companies andWarehouses dimension tables.

To create a star schemaTo create a star schema, take the following steps:

1 Right-click the StarSchemas folder and click Add New on the shortcutmenu. The Star Schema dialog box starts.

2 Enter the name of the new star schema.

3 For every table that must be included, right-click the desired data warehousetable and start the Add to StarSchema command, as shown in the followingfigure (see Figure 57).

4 Define the relevant joins between the fact table and the dimension tables.

Figure 57 Including a data warehouse table in a star schema

EXAMPLE

Page 110: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-16

Figure 58 Star Schema dialog

The INV_HISTORY star schema in the previous figure joins theDW_INV_HISTORY fact table to the following dimension tables:

� DW_COM_ITEMS.� DW_COM_WAREHOUSES.� DW_COM_COMPANIES.

As a result, you can link a table from a particular ETL model to tables from otherETL models.

To define joins, take the following steps:

1 Select the desired field from the fact table.

2 Drag the mouse pointer to the related field in the dimension table.

3 Repeat this procedure for every field, which must be included in the join.

You must include the LogComp field in every join. The data warehouse tablesusually contain records from multiple BaanERP company numbers. The originalBaanERP primary key does not uniquely identify the records in the datawarehouse table. Therefore, you must define joins to a dimension table�s original(BaanERP) primary key and the LogComp field.

NOTE

Page 111: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-17

This way of joining applies to both normal dimension tables and slow movingdimension tables. As a result, for a slow moving dimension table, you must notdefine joins to the surkey, but to the table�s original (BaanERP) primary key andLogComp field. During the initialization of the data warehouse, these joins areautomatically transformed into joins to the surkey.

In the previous figure the DW_INV_HISTORY fact table is joined to theDW_COM_ITEMS slow moving dimension table. The primary key of the original BaanERP Items table is the item field. The following fields are joined in the star schema:

Joined table fieldsDW_INV_HISTORY DW_COM_ITEMSItem itemLogComp LogComp

Running the Init DTS package initializes the data warehouse and transforms these joinsinto joins to the surkey field: a new field Item_LogComp_Surkey is added to theDW_INV_HISTORY table. This new field is joined to the surkey field in theDW_COM_ITEMS table.

EXAMPLE

Page 112: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Modeler output

Modeler User's Guide6-18

Page 113: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide7-1

The ETL Modeler is a developer�s tool, which you can use to define the actionsthat must be executed by the ETL process. The ETL Modeler is only used atdevelopment time. To run the actions defined in the ETL models, you must startthe following runtime components. These components are generated through theETL Modeler.

� Exchange schemas.Used to export records from the Baan tables you defined in your ETL model.

� DTS packages.Used to perform the transformations and load actions defined in your ETLmodel. You can run the DTS packages through the ETL Runner.

The ETL Modeler generates these runtime components on the BaanERP serverand on the DTS server.

For more information, refer to �Decision Manager Architecture� in Chapter 1,�Introduction.� Also refer to the BaanBIS Decision Manager 2.0 Administrator�sGuide (U7563A US)

To generate the runtime componentsTo generate these runtime settings, take the following steps:

1 Open the Management folder.

2 Double-click the Generate command.

7 Runtime components

NOTE

Page 114: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-2

The Deploy Model dialog box starts.

Figure 59 Deploy Model dialog box

Use the upper part of this dialog boxto specify the type of runtime componentsthat must be generated. Enter the required detailed settings in the lowest part ofthe dialog. This part consists of the following three form tabs:

� Baan Settings.� DTS Settings.� Data warehouse Settings.

Page 115: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-3

Upper part of the Data Warehouse Table dialog box� Exchange Schemas.

Select this check box to generate an exchange schema in BaanERP. Thisexchange schema includes the tables you defined in the Baan Tables folderof your ETL model.

� DTS Packages.Select this check box to generate Microsoft DTS packages. You can use DTSpackages to perform the transformations and load actions defined in yourETL model. You can run these DTS packages through the ETL Runner. Forinformation about the ETL Runner, refer to Chapter 9, �Other features.�

� OK.Click this button to save the entered settings and close the dialog box.

� Generate.Click this button to start the generation process.

Baan Settings form tab

Figure 60 Baan Settings form tab

Page 116: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-4

Use this form tab to specify settings for the exchange schemas and companygroups that must be generated in BaanERP.

� BW EXE Path.Specify the path of the bw executable here. The generation process uses a bwconnection to generate exchange schemas and company groups on theBaanERP server. You can select one of the following bw versions:

− BAAN IV.− BaanERP.− BaanSeries.

� BWC file.Specify the path of the bwc file that must be used by the generation process.The Baan Windows Configuration (bwc) file contains the login settings andenvironmental settings for the BaanERP server. Therefore, this BWC filedefines on which Baan system and in which company the exchange schemasare generated.

� Company Group.Specify the name of the company group that must be generated. The companygroup is automatically linked to the generated exchange schema. Aftergeneration, you must link the company group to an export session. For detailsabout company groups, refer tothe BaanBIS Decision Manager 2.0Administrator�s Guide (U7563A US).

To view the company groups in BaanERP, click the � button.

� Companies.Here, you must specify the company numbers to be included in the newcompany group. Separate the company numbers by commas. To view thecompany numbers in BaanERP, click the � button.

� Exchange Schema.The name of the exchange schema that must be generated, for example,B5CCOM20. The name of the exchange schema must be identical to thename of the ETL model. To view the exchange schemas in BaanERP, simplyclick the � button.

� Exchange Schema Description.Use this description to indicate which data is exported by the exchangeschema, for example, Export Common Dimension tables.

� Baan Data Pool Directory.The directory on the BaanERP server, in which the export process writes theASCII files. This directory is automatically linked to the generated companygroup.

NOTE

Page 117: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-5

� Save Baan Interaction File in.Here, you must specify the path of the interaction file. This file is createdautomatically if you save the settings entered in this form tab. The interactionfile contains parameters such as:

− Exchange schema.− Company group.− Company numbers.− A list of table fields that must be included in the exchange schema.

If you click the Generate button, the interaction file is transferred to theBaanERP server. There, the interaction file functions as input for the processthat generates the exchange schemas and company groups.

� Overwrite.Select this check box to replace an existing exchange schema and/or companygroup.

DTS Settings form tab

Figure 61 DTS Settings form tab

Page 118: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-6

Use this form tab to specify on which server the DTS packages is generated.

� SQL Server.The name of the server that contains the SQL Server 7 environment in whichthe DTS packages are generated.

� User identification.Specify the authentication parameters to log in to the server.

The following DTS packages are generated:

− Init.− CleanUpAll.− Upload.− LoadDummies.− JoinInStaging.− LoadDW.− CleanUpIntermediate.− Process_StagingArea.− Overall.

To view these DTS packages, open the Data Transformation Services folder inSQL Server Enterprise Manager.

For more information about DTS packages, refer to Appendix B.

Page 119: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-7

Data warehouse Settings form tab

Figure 62 Data warehouse Settings form tab

Use this form tab to specify the Data warehouse server and database. During thegeneration of the runtime components, the ETL Modeler creates some BaanBISDecision Manager 2.0 system tables in the data warehouse database. These tablesare used by utilities such as the ETL Runner.

� Data warehouse Server.The name of the server that contains the data warehouse database. Thegeneration process connects to the data warehouse database and adds recordsto a couple of system tables, such as dwm_data_link and dwm_star_relations.

� User identification.Specify the authentication parameters to log on to the server.

� Data warehouse Database.The name of the data warehouse database, for example, B5C20.

Page 120: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Runtime components

Modeler User's Guide7-8

Page 121: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide8-1

This chapter covers the following topics:

� To export ETL models.� To import ETL models.� To check ETL Models.� To compare ETL models.

To export ETL modelsYou can export an ETL model to an XML file, which is useful if you want totransfer a model to another ETL Modeler environment, for example, from a testenvironment to an operational environment.

To export an ETL model, take the following steps:

1 Right-click the ETL model.2 Click Export Model on the shortcut menu.

The Export Model dialog box starts.

Figure 63 Export Model dialog

8 Other features

Page 122: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Other features

Modeler User's Guide8-2

Use this dialog to export the ETL model to a Baan ETL model (.bem) file. Theformat of this .bem file is single line XML or multiline XML.

� Create multiline Model file.If you select this check box, the ETL model is exported to a multiline XMLfile. If you do not select this check box, a single-line XML file is generated.A multiline XML file offers more flexibility, and therefore enables you to:

− View the contents of the file in Notepad due to the fact that a multilaneXML file contains line breaks.

− Include the file in a version control system such as Microsoft VisualSourceSafe.

− Compare the contents of 2 multi-line XML files through the CompareModels command.

Single-line XML files do not offer these possibilities. You can only viewtheir contents through a Web browser, such as Internet Explorer. Anadvantage of single-line XML files, however, is that single-line XML filesoccupy less disk space.

� Export database settings of data sources.If you select this check box, the database settings of the data source tables inyour ETL model are included in the XML file. Examples of these settings are:

− For a SQL server datasource: Server name, login settings, and databasename.

− For a Microsoft Access database: Access file, user name, and password.

Exporting these settings is only useful if the model is imported on a serverthat offers access to these same datasources.

� Export File.Specify the path of the export file here. If you export an ETL model 2 filesare generated: <Export File Name>.bem and <Export FileName>_BaanTables.xml. For example, B5CCOM20.bem andB5CCOM20_BaanTables.xml. The first file contains the structure of the ETLModel. You can use this file to import the ETL model in another ETLModeler database. The second file contains details about the structure of theBaan tables in the ETL model. This file is used by the Metadata ReporterTool. For more details about the Metadata Reporter, refer to the BaanBISDecision Manager 2.0 Administrator�s Guide (U7563A US).

Page 123: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Other features

Modeler User's Guide8-3

The following figure shows a part of the B5CCOM20.xml file.

Figure 64 Sample XML file

To import ETL modelsThis option imports an ETL model from an XML file into the ETL Modelerdatabase.

To import an ETL model, take the following steps:

1 Select the File pull-down menu.

2 Click the Import Model command.

Page 124: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Other features

Modeler User's Guide8-4

Now, the Import Model from dialog box starts.

Figure 65 Import Model from dialog

Use this dialog to select the .bem file of the desired model. For example, selectthe B5CCOM20.bem file to import the B5CCOM20 ETL model.

To check ETL ModelsThe Check Model command checks the structure of your ETL model, andperforms actions such as:

� Checks the SQL syntax.� Checks for duplicate table names and duplicate step names.� Checks the structure of the tables.� Checks the indexes.� Checking for cycles in steps

To check an ETL model, take the following steps:

1 Right-click the ETL model.2 Click the Check Model command.

Now, the model is checked. If the structure of the model is correct, the message�The checked Model is valid� appears.

Page 125: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Other features

Modeler User's Guide8-5

If inconsistencies are found in the model, an error message appears. See thesample error message in the following figure.

Figure 66 Sample error message

To compare ETL modelsUse this option to find the differences between two ETL models. This option isuseful if you want to compare two versions of the same ETL model, for example,the operational version used by the end users and the test version in which thesoftware developers perform their changes.

The Compare Models command compares the contents of two .bem files andshows the differences. You must first export the ETL models before you cancompare them.

To compare two ETL models, take the following steps:

1 Select the Tools pull-down menu.2 Click the Compare Models command.

Now, the Compare Models dialog box starts.

Figure 67 Compare Models dialog

� First Model File.Specify the path name of the first model (.bem) file to be compared.

� Second Model File.Specify the path name of the second model (.bem) file to be compared.

Page 126: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Other features

Modeler User's Guide8-6

� Difference File.Here, you must specify the path name of the file the differences are writtento. The Compare Models command compares both model files for each line.If a difference is found, the corresponding lines of both model files are savedin the difference file. See the sample difference file at the end of this section.

� Display Difference File.If you select this check box, the content of the difference file appears whenthe compare action finishes.

The following figure shows an example of a difference file.

Figure 68 Sample difference file

The difference file contains two columns:

− The left column contains the syntax of the first model file in the CompareModels dialog box.

− The right column contains the syntax of the second model file in theCompare Models dialog box.

Page 127: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's Guide9-1

You can use the ETL Runner to run the Microsoft DTS packages generated bythe ETL Modeler. The DTS packages perform the actions that are defined in theETL models, including the following:

� Reads input tables/files.� Performs the transformations.� Loads the data warehouse tables.

Examples of DTS packages include UpLoad, JoinInStaging, LoadDW, andOverall. For more information about Microsoft DTS packages, refer toAppendix B.

To run a DTS packageTo run a DTS package, take the following steps:

1 Start the ETL Runner through Start: Programs/BaanBIS Decision ManagerConsole 2.0/ETL Modeler/ETL Runner.

2 Specify information about the DTS-package that must be run, such aslocation and name.

3 Specify the data warehouse to upload, such as location, database, and so on.

4 Provide information about where all upload data can be found, which are thedata links.

5 Start the process.

The ETL runner dialog consists of the following three form tabs:

� DTS Package Info.� Data Warehouse Info.� DataLink Info.

The following sections provide a detailed explanation about these form tabs.

9 ETL Runner

Page 128: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-2

DTS Package Info form tab

Figure 69 DTS Package Info form tab

Use this form tab to specify information about the DTS package that must run.

� DTS Server.Here, you must specify the name of the server on which the DTS package isstored.

� Use Windows NT authentication.If you select this option, the ETL Runner uses your Windows NT useraccount and password to connect to the SQL Server environment on the DTSserver.

� Use SQL Server authentication.If you select this option, the ETL Runner uses a SQL Server user account andpassword to connect to the SQL Server environment on the DTS server.

Page 129: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-3

� Username.The SQL Server user account that will be used to run the DTS package.

� Password.The SQL Server password that belongs to the specified username.

� Package.The DTS package that must be run. You can select the desired package froma drop down list.

� Error File.The name and path of the error file in which all details of the executionprocess are stored. This logfile is useful for tracing the process when an erroroccurs.

� Truncate Error File.If you select this check box, the logfile is truncated before the execution ofDTS package starts. Information about previous execution processes isremoved.

Page 130: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-4

Data Warehouse Info form tab

Figure 70 Data Warehouse Info form tab

Use this form tab to specify information about the data warehouse database.

� DW Server.Here, you must specify the name of the server that contains the datawarehouse database.

� Use Windows NT authentication.If you select this option, the ETL Runner uses your Windows NT useraccount and password to connect to the data warehouse database.

� Use SQL Server authentication.If you select this option, the ETL Runner uses a SQL Server user account andpassword to connect to the data warehouse database.

Page 131: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-5

� Username.The SQL Server user account used during the execution of the DTS package.Usually, the sa account is used, which is the SQL Server databaseadministrator account.

� Password.The SQL Server password used during the execution of the DTS package.

� DW Database.The name of the data warehouse database.

� Write Completion Event to Windows Event Log.If you select this check box, the ETL Runner writes a completion event in theWindows NT Event Log, after running the DTS package. You can view thecompletion event through the Windows NT Event Viewer, which enables youto easily check the results of nightly execution of the process.

Page 132: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-6

DataLink Info form tab

Figure 71 DataLink Info form tab

Use this form tab to specify information about the data links of the ETL model.

Every ETL model contains one or more data links. A data link specifies wherethe source data can be found. A data link points to a directory (for ASCII files,data source BflatFile), to a database server, or to an Excel worksheet. If an ETLmodel includes multiple data links, you must enter specifications for each of thelinks.

If a data link is selected from the list, detail questions will appear, as shown inthe previous figure (see Figure 71).

BFlatFile is the most common Data Link. This one is described in detail in thissection, while other data links are self-explanatory.

Page 133: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-7

� Source Directory.The DTS-package needs data for input. The source directory is the directorythat contains the input txt files. This can be a local directory on the ETLmachine or a shared directory, which is accessed through the network. Thesource directory is accessed at the moment the DTS package runs.

If you plan to use a nightly run, check whether the source directory will beaccessible at the moment of running the DTS package.

� First Copy Remote Data.Select this check box if the input txt files are not accessible through thenetwork. For example, if BaanERP runs on a UNIX server, the ETL Runnercannot access the .txt files generated by the export sessions. In the next fields,you must specify a remote directory and a copy method.

� Remote Directory.The UNIX or Windows NT directory from which the .txt files are copied.

� Copy Data from Share.Select this option if the input txt files must be copied from a Windows NTdirectory.

� Copy Data via FTP.Select this option if the input txt files must be copied from a directory on aUNIX server. The copy process uses the FTP protocol.

� Server.The name of the UNIX server from which the input .txt files must be copied.

� Username.The UNIX login code used by the FTP process.

� Password.The UNIX password used by the FTP process.

� Test Connection.Click this button to test all remote-specifications. The system will perform atest-FTP-action to the remote directory on the FTP-server.

� Poll Interval.Before copying the .txt files to the local system, the ETL Runner reads thestatus file on the remote (BaanERP) host to take note of the status of theexport process. The ETL Runner will only copy the .txt files if the status fileholds Ready. If the status is Running or Exchange-Ready, the ETL Runnerwill wait a while and try again later. Poll Interval is the number of minutes towait for the next try.

NOTE

Page 134: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

ETL Runner

Modeler User's Guide9-8

� Poll Duration.The maximum number of minutes to wait. Poll Interval = 2 and Poll Duration= 10 mean that the system will try to copy for 6 times.

When data is copied from remote to local the content of the remote status file ischanged to Idle, as an indication that this set of data is already loaded.

After you enter all the required settings, you can save the ETL Runnerconfiguration for later reuse. Click the Execute button to start the process. Theprogress of the process is shown in the status bar of ETL Runner. Depending onwhich DTS-package runs, some windows can scroll over the screen.

Page 135: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's GuideGuidelines - Page 1

This appendix contains the following sections:

� Naming conventions.This section contains guidelines for naming the various components in astandard ETL model.

� Best practices.This section contains various hints for developing efficient ETL models.

Naming conventionsBaan Tables, Text Files, Enumerates, and DataSourceTablesThe names of these components must be prefixed with UP_<3 digit modelcode>_. UP stands for upload table.

For example, the Countries table in the Common model must be namedUP_COM_COUNTRIES, the Order Origins table in the Inventory model mustbe named UP_INV_ORDER_ORIGINS, and so on.

Steps and Computed StepsThe names of Steps and Computed Steps must be prefixed with TR_<3 digitmodel code>_. TR stands for transformation.

For example, the step for the Countries table in the Common model must benamed TR_COM_COUNTRIES, the step for Dimension1 R2B in the Financemodel must be named TR_FIN_DIMENSION1_R2B, and so on.

Appendix A Guidelines

Page 136: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Guidelines

Modeler User's GuidePage 2 - Guidelines

Data warehouse tablesThe names of data warehouse tables must be prefixed with DW_<3 digit modelcode>_. DW stands for data warehouse.

For example, the data warehouse table for the Countries table in the Commonmodel must be named DW_COM_COUNTRIES, the data warehouse table forthe Order Origins table in the Inventory model must be named asDW_INV_ORDER_ORIGINS, and so on.

SQL statementsAn SQL statement must have the same name as the view / table the SQLstatement creates. If the SQL statement is used to create a final view / DW table,the name of the view / table, and the SQL statement also, must be prefixed byDW_<3 digit model code>_. Otherwise, the name must not have DW_ prefixed.

For example, the SQL statement for creating an intermediate view to retrieve thelast issue in the Inventory model must be named as INV_LAST_ISSUE with thedefinition as CREATE VIEW INV_LAST_ISSUE AS�, but the SQL statementto retrieve the final time periods view in the Common model must be named asDW_COM_TIMEPERIODS with the definition as CREATE VIEWDW_COM_TIMEPERIODS AS�.

Star schemasA star schema must have the same name as the FACT table used in the starschema, but without the prefix DW_.

For example, the star schema for the Cycle Counting and Adjustment Orders isbased on the fact table DW_INV_CC_AND_ADJ, therefore, this star schemamust be named INV_CC_AND_ADJ.

Table fieldsAvoid the use of underscores (_) in the table field names. Also, the names andabbreviations used must be consistent throughout the model.

Page 137: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Guidelines

Modeler User's GuideGuidelines - Page 3

Best practicesEnum descriptionsKeep the length of the enum description fields as described here:

For the enum fields of domain tcyesno, the length of the field description fieldsmust be five.

For the enum fields of other domains, the length of the field description fieldsmust be 25.

CurrenciesThe currencies must be specified as follows:

� HomeCurrency (for home currency).� LocalCurrency (for local currency).� ReportingCurrency (for reporting currency).� DWCurrency (for data warehouse currency).

Handle numbers for Baan Data NavigatorTo define the handle numbers, fill in the appropriate integer value in the Handlecolumn in the data warehouse table definition. Do not add a separate field forhandle number in the steps.

A handle number in the ETL Modeler is a nine-digit integer value, which willhave the following format:

110 TTT XXX.

� The first three numbers represent BaanBIS Decision Manager 2.0.� TTT is the code for each template.

The following codes must be used for the templates:

− 001: Common.− 002: Finance.− 003: Inventory.− 004: Manufacturing.− 005: Project.− 006: Purchase.− 007: Service.− 008: Sales.

Page 138: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Guidelines

Modeler User's GuidePage 4 - Guidelines

� XXX.First free number. Each template can start with 001 for the first table, 002 forthe second table, and so on.

Do not keep handle numbers for enum fields.

Date fields / UTC date fieldsDefine the fields of type Date / UTC Date in BaanERP as date fields while youcreate the text files in the modeler. Currently, the ETL Modeler does not supportselection of fields of type UTC Date in Baan Tables.

Integer fieldsWhile you define integer fields, you can use the following types:

� If the value of a field can only be between 0 and 255, use the data typetinyint.

� If the value of a field can only be between �32767 and 32767, use the datatype smallint.

� If the value of a field can only be between �2147352578 and 2147352578,use the data type int.

Precedence of SQL statementsSpecify the precedence for the SQL statements to ensure correct execution of theSQL statements.

IndexesTake care of the following:

� Define a primary index for all the tables.

� Define at least one secondary index for all the slow moving dimensions.

� Name the primary index Pkey, the first secondary index Skey1, the secondsecondary index as Skey2, and so on.

StepsKeep the number of steps to the minimum number possible for performanceimprovement. The bigger the number of steps, the more time the DTS packagestake to generate and run. Also, a large number of steps results in a large numberof intermediate tables. Each intermediate table occupies disk space.

NOTE

Page 139: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Guidelines

Modeler User's GuideGuidelines - Page 5

Consider the following example:

Figure 72 Sample table relationship

Table 1 is the main table, and Field C in table 3 is required. However, no directlink exists between Table 1 and Table 3. However, a link is possible throughTable 2, as shown in the figure. This snowflake type relation can be carried outin one step. Therefore no additional step I required to join Table 2 and Table 3,which will help reduce the number of steps.

Copies of dimension tablesWhenever a single dimension table must be used multiple times in a star schema,copies of the DW table for that dimension must be created. To achieve this, youmust create a copy of the final TR table. The main DW table must be based onthe main TR table and the copy of the DW table must be based on the copy of theTR table.

For example, in the star schema for replenishment history, the warehousedimension must be liked with the replenishing warehouse, as well as thedestination warehouse. If the final TR table is TR_COM_WAREHOUSES2, thena copy of this table must be created as TR_COM_WAREHOUSES2_COPY.DW_COM_WAREHOUSES must be based on TR_COM_WAREHOUSES2and DW_COM_WAREHOUSES_COPY must be based on theTR_COM_WAREHOUSES2_COPY.

You must add a _COPY suffix to the name of the original table while you namethe copy. If multiple copies must be created, then the suffix can be _COPY1,_COPY2, and so on.

Page 140: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Guidelines

Modeler User's GuidePage 6 - Guidelines

Page 141: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

Modeler User's GuideDTS packages - Page 1

The DTS packages run the actions defined in an ETL model. These packagesperform actions such as read the input tables/files, perform the transformations,and load the data warehouse tables.

Appendix B DTS packages

Page 142: Modeler User's Guide - baansupport.com user guide.pdf · Modeler User’s Guide v This document is a manual for developers who want to build new ETL models or customize existing ETL

DTS packages

Modeler User's GuidePage 2 - DTS packages

The following table lists all DTS-packages that exist per ETL model and theirmain function.

DTS PackagesDTS Package Description and Function<ETL Model>_Init The package that will create an empty

data warehouse for that specific ETLmodel. The package will create allnecessary tables, views, and metadatatables (dwm_*, data link) in the datawarehouse database.This package is only required to runonce, and as first per module.

<ETL Model>_Upload Reads data from data sources (.txt filesor other) and writes the data into theupload tables of the staging area.

<ETL Model>_LoadDummies Adds dummy records to the uploadeddata in the staging area.

<ETL Model>_JoinInStaging Performs all transformations and joins asmodeled in the Steps of the ETLModeler.

<ETL Model>_LoadDW Copies the relevant data from stagingarea into the data warehouse. After thisstep, the data warehouse is ready foranalysis.

<ETL Model>_CleanUpAll Cleans up all relevant intermediatetables of the staging area. Must be runbefore the _Upload package.

<ETL Model>_Process_StagingArea This is a master-package processing upto the staging area. From this package,other packages are started and in thefollowing order: CleanUpAll, Upload,LoadDummies, and JoinInStaging.LoadDW is not run.You can use this package to process thestaging area. After that, the staging areacan be checked for quality. If this is OK,the remaining package, LoadDW, canrun to copy data from staging area intodata warehouse and finalize thecomplete upload.

<ETL Model>_Overall The master-package executing all otherpackages: CleanUpAll, Upload,LoadDummies, JoinInStaging, andLoadDW.This is the package that performs allsteps of the data warehouse upload