Tuesday, 31 May 2011

Creating Cubes and Dimensions Overview:

Creating Cubes and Dimensions Overview:
The Warehouse Designer provides an interface to let you create and edit cubes and dimensions. Multi-dimensional metadata refers to the logical organization of data used for analysis in OLAP applications. This logical organization is generally specialized for the most efficient data representation and access by end users of the OLAP application. The following sections provide an overview of the concepts that are relevant to the multi-dimensional features of PowerMart and PowerCenter.

What is Multi-Dimensional Metadata?
The multi-dimensional model is a key aspect of data warehouse design. A well-designed dimensional model can help you organize large amounts of data. The dimensional model was originally created for the retail industry, where analysts view business data by simple dimensions, such as products and geographies. This dimensional model consists of a large central fact table and smaller dimension tables. The fact table contains the measurable facts, such as total sales and units sold, and disjoint dimensions represent the attributes pertaining to various business segments of the industry. The central fact table is the only table in the schema with multiple joins connecting it to the dimension tables. The dimension tables in turn each have a single join connecting them to the central fact table.

There are different types of multi-dimensional models depending on the degree of redundancy in the logical schema. More redundancy can improve the efficiency of data access but represents a less normalized view of the logical schema. The most common type of a multi-dimensional schema is called a star schema. A star schema is a normalized multi-dimensional model where each of its disjoint dimensions is represented in a single table.

Another type of a normalized multi-dimensional model is a snowflake schema. A snowflake schema is logically similar to a star-schema except that at least one dimension is represented in two or more hierarchically-related tables. The star schema can become a snowflake schema if the product dimension is represented by means of multiple tables. For example, you could add one dimension table for the main product attributes, one for the brand attributes, and one for a specific brand attributes. Non-normalized multi-dimensional models have duplicate attributes (or redundant data) in tables that are associated with a dimension. This allows you to quickly retrieve various attributes of a dimension without having to perform multiple joins between tables in the dimension.

Key Elements of Multi-Dimensional Metadata:

Key Elements of Multi-Dimensional Metadata:
Term
Definition
Aggregate
Pre-stored summary of data or grouping of detailed data which satisfies a specific business rule. Example rules: sum, min, count, or combinations of them.
Level
A specific property of a dimension. Examples: size, type, and color.
Cube
A set of related factual measures, aggregates, and dimensions for a specific dimensional analysis problem. Example: regional product sales.
Dimension
A set of level properties that describe a specific aspect of a business, used for analyzing the factual measures of one or more cubes which use that dimension. Examples: geography, time, customer and product.
Drilling
Drilling is the term used for navigating through a cube. This navigation is usually performed to access a summary level of information or to provide more detailed properties of a dimension in a hierarchy.
Fact
A fact is a time variant measurement of quantitative data in a cube; for example, units sold, sales dollars, or total profit.
Hierarchy
The hierarchy concept refers to the level of granularity represented by the data in a particular dimension of a cube. For example, state, county, district, and city represent different granularity in the hierarchy of the geography dimension.
Measure
The means for representing quantitative data in facts or aggregates. Example measures are total sales or units sold per year.
Normalization
A process used for reducing redundancies and removing anomalies in related dimension tables in various hierarchies.
Redundancy
The term used for referring to duplication of data among related tables for the sake of improving the speed of query processing.
Star Schema
A normalized multi-dimensional model in which each disjoint dimension is represented by a single table.
SnowFlake Schema
A normalized multi-dimensional model in which at least one dimension is represented by two or more hierarchically related tables.


Creating a Dimension:
Before you can create a cube, you need to create dimensions. Complete each of the following steps to create a dimension:
  • Enter a dimension description.
  • Add levels to the dimension.
  • Add hierarchies to the dimension.
  • Add level instances to the hierarchies.

Step 1. Create a Dimension
  • In the Warehouse Designer, choose Targets-Create/Edit Dimension. The Dimension Editor displays.
  • Select Add Dimension.
  • Enter the following information:
    • Name. Dimension names must be unique in a folder.
    • Description.
    • Database type. The database type of a dimension must match the database type of the cube. Note: You cannot change the database type once you create the dimension.
  • Click OK.

Step 2. Add Levels to the Dimension:
After you create the dimension, add as many levels as needed. Levels hold the properties necessary to create target tables.
  • In the Dimension Editor select Levels and click Add Level.
  • Enter a name and description for the level. The Level name must be unique within the dimension.
  • Click Level Properties.
  • Click the Import from Source Fields button. The name of a level property must be unique within the dimension.
  • Select a source table from which you want to copy columns to the level. The columns display in the Source Fields section.
  • Select the columns you want to add to the level.
  • Click the Copy Columns button to add source columns to the level.
  • Click the Add Columns button to add a new column to the level.
  • Click OK after you add all the columns. The Dimension Editor displays the new level.

Step 3. Add Hierarchies to the Dimension:
  • In the Dimension Editor, select Hierarchies.
  • Click Add Hierarchy.
  • Enter a hierarchy name, description, and select normalized or non-normalized. Normalized cubes restrict redundant data. Non-normalized cubes allow for redundant data, which increases speed for retrieving data.

Step 4. Add Levels to Hierarchy:
After you create a hierarchy, you add levels to it. You can have only one root level in a hierarchy. To add a level to a hierarchy:
  • From the Dimension Editor, drill down to view the levels in the dimension.
  • Drag the level you want to define as the root level in the hierarchy. The root level is the level of finest granularity.
  • Enter a target table name and description of the target table.
  • Click OK. A window displays a listing of all the objects affected by the new level.
  • Click OK. The new level displays under the hierarchy.


Creating a Cube:
After you create dimensions, you can create a cube. To create a cube:
  • From the Warehouse Designer, choose Targets-Create Cube.
  • Enter the following information:
    • Cube name. The cube name must be unique in a folder.
    • Cube type: Normalized or Non-normalized. Normalized dimensions must have a normalized cube. Likewise, non-normalized dimensions must have a non-normalized cube.
    • Database type. The database type for the cube must match the database type for the dimensions in the cube.
  • Click Next.
  • Specify the dimensions and hierarchies to include in the cube.
  • Click Next.
  • Add measures to the cube. You can copy columns from source tables or add new columns. Measure names must be unique within a fact. Level names must be unique within each cube.
  • Add a name for the fact table.
  • Click Finish. The Designer adds the cube and fact tables to the workspace. Next, you need to generate the SQL for the tables.

Editing a Cube:
You can edit a cube in the Warehouse Designer. You cannot edit a fact table or dimension table directly. If you want to change a column in a fact table or dimension table, you need to edit the cube or dimension. To edit a cube:
  • Choose Targets-Edit Cube.
  • You can modify any settings in the dimension except the following:
    • Database type
    • Dimension type (normalized or non-normalized)
  • Click Close.

Editing a Dimension:
You can edit dimensions in the Warehouse Designer. You cannot, however, change the database type once you create a dimension. If you edit a dimension, the Designer marks all mappings with the dimension invalid. To edit a dimension:
  • Choose Targets-Create/Edit Dimension.
  • You can modify any settings in the dimension except the following:
    • Database type
    • Dimension type (normalized or non-normalized)
  • Click Close.

Deleting a Cube or Dimension:
You can delete a cube or dimension from the Navigator in the Designer. Unlike target tables, you cannot delete cubes and dimensions in the Warehouse Designer workspace. When you delete a cube, all fact tables associated with the cube are deleted. When you delete a dimension, all dimension tables are deleted, as well as all references to the dimension in any cubes. To delete a cube or dimension:
  • In the Designer, open the repository.
  • In the Navigator, select the cube or dimension you want to delete.
  • Press Delete. A message prompts you to verify if you want to delete the cube or dimension.
  • Click OK to delete the cube or dimension.

Opening and Closing a Cube:
You can open a cube in the Warehouse Designer. To open a cube:
  • Open a repository and open a folder.
  • Open the Warehouse Designer.
  • Select the cube and drag it into the workspace.
  • A message prompts you to clear the workspace.
  • Click OK to open the cube. The Designer clears the workspace and displays all fact and dimension tables associated with the cube.
To close a cube in the Warehouse Designer workspace:
  • Choose Targets-Close Cube. The Designer closes the cube, saving the layout of all the tables.


Tips for Creating Cubes and Dimensions:
Consider the following tips when working with cubes and dimensions:
  • If you want to copy a cube, you need to copy the folder that stores the cube.
  • To view the levels of a cube or dimension, you can either edit the cube or dimension or use the Navigator in the Repository Manager.
  • You cannot revert to previous versions of cubes or dimensions.
  • You can delete a cube or dimension from the Navigator.
  • You can delete a dimension using Targets-Create/Edit Dimension.
  • You cannot delete cubes and dimensions from the Warehouse Designer workspace.
  • If you want to change a column in a fact table or dimension table, you need to edit the cube or dimension. You cannot edit a fact table or dimension table directly.
  • If you delete a level, the Designer deletes the associated level instances in hierarchies. The Designer also removes the level instance from any associated cubes.
  • A primary key is generated for each fact and dimension table. The format is GK_TABLE_NAME.
  • A foreign key is added to the appropriate fact table when you associate a dimension level instance to the fact table.
  • You can drag and drop a cube to the workspace and then edit the cube and cardinality (by double-clicking the links).
  • You cannot delete or create a link between fact and dimension tables in the workspace. You can only delete and create links in the Cube and Dimension Editors. You can create a graph in the hierarchy.

Mapplets Overview:

Mapplets Overview:
A mapplet is a reusable object that represents a set of transformations. It allows you to reuse transformation logic and can contain as many transformations as you need. You create mapplets in the Mapplet Designer. Create a mapplet when you want to use a standardized set of transformation logic in several mappings. For example, if you have several fact tables that require a series of dimension keys, you can create a mapplet containing a series of Lookup transformations to find each dimension key. You can then use the mapplet in each fact table mapping, rather than recreate the same lookup logic in each mapping.

To create a mapplet, you add, connect, and configure transformations to complete the desired transformation logic. After you save a mapplet, you can use it in a mapping to represent the transformations within the mapplet. When you use a mapplet in a mapping, you use an instance of the mapplet. Like a reusable transformation, any changes made to the mapplet are automatically inherited by all instances of the mapplet. When the server runs a session using a mapplet, it expands the mapplet. The server then runs the session as it would any other session, passing data through each transformation in the mapplet as designed. Mapplets provide a wide range of flexibility to simplify your mappings. Mapplets can:
  • Include source definitions. A mapplet can contain source definitions and a source qualifier to provide source data for a mapping.
  • Accept data from sources in a mapping. A mapplet with no source definitions can accept data from a mapping through mapplet input ports.
  • Include multiple transformations. A mapplet can contain as many transformations as you need.
  • Pass data to multiple pipelines. A mapplet can contain multiple groups of output ports, or output groups. You can connect ports in each output group to a different pipeline in the mapping.
  • Contain unused ports. Like a reusable transformation, a mapplet can have input and output ports that are not used in a mapping. This allows you to design a mapplet for a range of uses.


Mapplet Components:
A mapplet can contain transformations, reusable transformations, and shortcuts to transformations. You can include as many transformations in a mapplet as you need. Although you can use reusable transformations and shortcuts in a mapplet, to protect the validity of your mapplet, use a copy of a transformation instead. Reusable transformations and shortcuts automatically inherit changes to their original transformations. If you use a reusable transformation or shortcut in a mapplet, changes to these objects can invalidate the mapplet and every mapping using the mapplet. You can create a non-reusable instance of a reusable transformation. Each mapplet must include the following:
  • One Input transformation, Source Qualifier, or ERP Source Qualifier transformation. If you include a Source Qualifier or ERP Source Qualifier, you must include at least one source definition to the mapplet.
  • At least one Output transformation.

List of Mapplet Objects
Repository Object
Number per Mapplet
Comments
Advance External Procedure transformation
Unlimited

Aggregator transformation
Unlimited

ERP Source Qualifier transformation
0 to 1
You can use one ERP Source Qualifier, if the mapplet does not contain an Input or Source Qualifier transformation.
Expression transformation
Unlimited

External Procedure transformation
Unlimited

Filter transformation
Unlimited

Input transformation
0 to 1
You can use one Input transformation, if the mapplet does not contain a Source Qualifier or ERP Source Qualifier transformation.
Lookup transformation
Unlimited
You can use connected and unconnected Lookup transformations. Do not use PowerMart 3.5-style LOOKUP functions in a mapplet.
Output transformation
Unlimited
Minimum: 1
Use at least one Output transformation per mapplet.
Rank transformation
Unlimited

Reusable transformations
Unlimited
You can use reusable transformations for transformations permitted in a mapplet.
Sequence Generator transformation
Unlimited
Use reusable Sequence Generators only.
Source Definition
Unlimited
You can use flat file, relational, and ERP source definitions if the mapplet does not contain an Input transformation. You can include multiple source definitions if you connect them to a single source qualifier. You cannot use COBOL, MQ, or XML source definitions.
Source Qualifier transformation
0 to 1
You can use one Source Qualifier, if the mapplet does not contain an Input or ERP Source Qualifier transformation.
Shortcuts
Unlimited
You can use shortcuts to transformations permitted in a mapplet.
Stored Procedure transformation
Unlimited
Do not use pre- or post-session stored procedures.
Update Strategy transformation
Unlimited


Overriding Transformation Properties:
Like transformations in mappings, when you configure a session using a mapplet, you can override transformation properties for transformations in a mapplet.

Unsupported Repository Objects:
The Designer does not support the following objects in a mapplet:
  • COBOL source definitions
  • Joiner transformations
  • Normalizer transformations
  • Non-reusable Sequence Generator transformations
  • Pre- or post-session stored procedures
  • Target definitions
  • PowerMart 3.5-style LOOKUP functions
  • XML source definitions
  • IBM MQ source definitions


Mapplet Input:
Data passing through a mapplet comes from a source. Source data for a mapplet can originate from one of two places:
  • Sources within the mapplet. Mapplet input can originate from within the mapplet if you include one or more source definitions in the mapplet. When you use more than one source definition in a mapplet, you must connect the sources to a single Source Qualifier or ERP Source Qualifier transformation. When you use the mapplet in a mapping, the mapplet provides source data for the mapping.
  • Sources outside the mapplet. Mapplet input can originate from outside a mapplet if you include an Input transformation to define mapplet input ports. When you use the mapplet in a mapping, data passes through the mapplet as part of the mapping pipeline.

Using Sources Inside a Mapplet:
You can use one or more source definitions in a mapplet to provide source data for the mapplet. Source definitions can represent either file, relational, or ERP data. When you include source definitions in a mapplet, you can connect them to one of the following transformations:
  • Source Qualifier
  • ERP Source Qualifier
You cannot connect sources to a Normalizer transformation. You cannot use COBOL, MQ, or XML source definitions in a mapplet. When you use sources in a mapplet, the resulting mapplet has no input ports. When you use the resulting mapplet in a mapping, the mapplet provides source data for the mapping and is the first object in the mapping pipeline.

Overriding the Default SQL Query in a Mapplet:
When you use a source qualifier in a mapplet, you can configure the transformation properties as you would if it were in a mapping. However, if you override the default SQL query in the source qualifier, the Designer prompts you to connect all mapplet output ports when you use the mapplet in a mapping.

Using Sources Outside the Mapplet:
You can connect a mapplet to sources in a mapping by creating mapplet input ports. To create mapplet input ports, you add an Input transformation to the mapplet. Each port in the Input transformation connected to another transformation in the mapplet becomes a mapplet input port. When you use an Input transformation in a mapplet, you must connect at least one port in the Input transformation to another transformation in the mapplet. You cannot connect ports in an Input transformation directly to an Output transformation.

You can connect an Input transformation to multiple transformations in a mapplet. However, you can connect each port in the Input transformation to only one transformation in the mapplet. For example, you can connect one port in an Input transformation to a Lookup transformation and a different port to an Expression transformation. You cannot connect the same port to both the Lookup transformation and the Expression transformation. When you use the mapplet in a mapping, the Designer displays all available input ports below the Input transformation name. You do not have to use all mapplet input ports in each mapping, but you must use at least one.

Rules for Mapplet Input:
Use the following rules when designing mapplet input:
  • Include one of the following in a mapplet:
    • One or more source definitions, connected to a source qualifier
    • A single Input transformation with at least one connected port
  • Use only file, relational, and ERP sources in a mapplet. Do not use COBOL, MQ, or XML sources.
  • Do not use a Normalizer transformation in a mapplet.
  • Connect Input transformation port to only one other transformation in the mapplet.
  • Do not connect Input transformation ports to an Output transformation.


Mapplet Output:
To pass data out of a mapplet, you create mapplet output ports. To create mapplet output ports, you add Output transformations to the mapplet. Each port in an Output transformation connected to another transformation in the mapplet becomes a mapplet output port. Each mapplet must contain at least one Output transformation, and at least one port in the Output transformation must be connected within the mapplet.

Each Output transformation in a mapplet represents a group of mapplet output ports, or output group. Each output group can pass data to a single pipeline in the mapping. To pass data from a mapplet to more than one pipeline, create an Output transformation for each pipeline. When you use a mapplet in a mapping, you connect ports in each output group to different pipelines. You do not have to use all mapplet output ports in a mapping, but you must use at least one. For example, mapplet mplt_LookupAndCompare contains three Output transformations to allow the mapplet to connect to three different pipelines in a mapping. Notice the Output transformation OUT_UpdateChanges contains an unconnected port named LAST_NAME.

Rules for Mapplet Output:
Use the following rules when designing mapplet output:
  • Include at least one Output transformation in a mapplet with at least one connected port.
  • Create an Output transformation for each mapplet output group in the mapplet. Each Output transformation represents a mapplet output group, and each mapplet output group can be connected to a different pipeline in a mapping.


Step-1: Creating a Mapplet:
Before designing the transformation logic within a mapplet, create a new mapplet. To create a new mapplet:
  • In the Mapplet Designer, choose Mapplets-Create Mapplet.
  • Enter a descriptive mapplet name. The recommended naming convention for mapplets is mpltMappletName.
  • Click OK. The Mapping Designer creates a new mapplet in the Mapplet Designer.
  • Choose Repository-Save.

Adding a Mapplet Description:
You can enter a description for the mapplet. You can also link a mapplet to business documentation saved elsewhere. Descriptions appear on the Transformation tab of the mapplet when used in the Mapping Designer. To enter a mapplet description:
  • With a mapplet open, choose Mapplet-Edit.
  • Enter a description of the mapplet.
  • Click OK and save your changes to the repository.


Step 2. Creating Mapplet Transformation Logic:
In the Mapplet Designer, you create, configure, and connect the transformations you need to create the mapplet transformation logic. When designing the mapplet, think about how you can make the transformation logic flexible enough to use in different mappings.

Active and Passive Mapplets:
A mapplet can be active or passive depending on the transformations in the mapplet. Active mapplets contain one or more active transformations. Passive mapplets contain only passive transformations. Active mapplets contain at least one of the following transformations:
  • Advanced External Procedure
  • Aggregator
  • ERP Source Qualifier
  • Filter
  • Rank
  • Router
  • Source Qualifier
  • Update Strategy

Passive mapplets contain only the following transformations:
  • Expression
  • External Procedure
  • Input
  • Lookup
  • Output
  • Sequence Generator
  • Stored Procedure
When you use a mapplet in a mapping, all transformation rules apply to the mapplet depending on the mapplet type. For example, as with an active transformation, you cannot concatenate data from an active mapplet with a different pipeline.

Transformation Properties:
Like transformations in mappings, you can set the tracing level for an individual transformation in a mapplet. When you do this, the Informatica Server provides the configured level detail in session log for every instance of the transformation in every mapping using the mapplet. You can configure all other transformation properties in a mapplet as you would in a mapping. For details on each transformation property, see the individual transformation chapters in this book. You can override transformation tracing levels and other transformation properties with a session override.


Step 3. Creating Mapplet Ports:
When you create a mapplet, use an Input transformation to define mapplet input ports if the mapplet contains no sources. Use Output transformations to create output ports, creating one Output transformation for each mapplet output group. Only ports in an Input or Output transformation that are connected to other transformations in the mapplet become mapplet input or output ports. Unconnected ports do not display when you use the mapplet in a mapping. You can connect an Input transformation to only one transformation in a mapplet. To pass the same values to two separate pipelines, connect the Input transformation to another transformation, such as an Expression transformation, then split the pipeline.

Configuring Mapplet Port Attributes:
You can configure the following port attributes in an Input or Output transformation.
  • Port name
  • Description

You configure all other port attributes by connecting the Input or Output transformation port to another transformation in the mapplet. The Input or Output transformation port then inherits the following attributes from the connected port:
  • Datatype
  • Precision
  • Scale

If you change a port connection, the Designer automatically updates the Input or Output transformation port to match the attributes of the new connection. For example, you have an Output transformation port, NAME, connected to a string port in an Expression transformation. You then delete that connection and connect NAME to a decimal port. When you make the second connection, the NAME port becomes a decimal port with the precision and scale of the connected port. You can view the datatype, precision, and scale of available mapplet ports when you use the mapplet in a mapping.

Adding Ports to Input/Output Transformations:
After creating transformation logic for a mapplet, you can create mapplet ports. If the mapplet includes no source definitions, use an Input transformation to define mapplet input ports. Use Output transformations to create groups of mapplet output ports. You can create a mapplet port in two ways:
  • Add and name ports in the Input/Output transformation. You can create port names in Input and Output transformations. You can also enter a description for each port name. The port has no defined datatype, precision, or scale until you connect it to a transformation in the mapplet.
  • Drag a port from another transformation. You can create an input or output port by dragging a port from another transformation into the Input or Output transformation. The new port inherits the port name, description, datatype, and scale of the original port. You can edit the new port name and description in the transformation.

To create mapplet ports:
  • In Mapplet Designer, choose Transformations-Create.
  • If the mapplet contains no sources, select Mapplet Input to create an Input transformation. Otherwise, select Mapplet Output to create an Output transformation. Enter a name, and click Create. You cannot include more than one Input transformation in a mapplet.
  • Repeat Step 2 to create as many Output transformations as you need, then click Done. You must use at least one Output transformation to define output ports. Create a new Output transformation for each output group in the mapplet.
  • If you create an Input transformation, drag ports from the first transformation in the mapplet pipeline to the Input transformation ports. This creates and connects ports in one step. You can also create and connect ports separately:
    • Double-click the Input transformation title bar, click the Ports tab, and create and name ports. Then click OK.
    • Then connect the ports to the first transformation in the mapplet pipeline.
  • Create all desired output ports by connecting the last transformation in the mapplet pipeline to the Output transformation. This creates and connects ports in one step. You can also create and connect ports separately:
    • Double-click the Output transformation title bar, click the Ports tab, and create and name ports and click OK.
    • Then connect the ports to the last transformation in the mapplet pipeline.
  • Repeat Step 5 for each Output transformation in the mapplet. Each Output transformation represents a mapplet output group.
  • After connecting all necessary ports, choose Repository-Save.
  • Check the Output Window for the validation status.

The Designer displays a messages stating whether the mapplet is valid. If the mapplet is not valid, look for additional messages in the Output Window, correct the problem, and re-save the mapplet.


Working with Mapplets:
After you create a mapplet, you can validate or edit the mapplet in the Mapplet Designer. You can also use the Designer to copy mapplets, export and import mapplets, create shortcuts to mapplets, and delete mapplets from the repository.

Validating Mapplets:
The Designer validates a mapplet when you save it. You can also validate a mapplet using the Mapplet-Validate menu command. When you validate a mapplet, the Designer writes all relevant messages about the mapplet in the Output Window. Use details in the Output Window to correct invalid mapplets. The Designer validates the pipeline of a mapplet as it does a mapping, checking for errors such as invalid expressions or missing transformation input. The Designer also performs additional checks specific to mapplets. It marks a mapplet valid only when all of the following are true:
  • The mapplet contains exactly one of the following:
    • Input transformation with at least one port connected to a transformation in the mapplet.
    • Source Qualifier transformation with at least one port connected to a source definition.
    • ERP Source Qualifier transformation with at least one port connected to a source definition.
  • The mapplet contains at least one Output transformation with at least one port connected to a transformation in the mapplet.
  • Each Output transformation has a logical source in an Input, Source Qualifier, or ERP Source Qualifier transformation.

To validate a mapplet using the menu:
  • With the mapplet open, choose Mappings-Validate.
  • Read the messages in the Output Window.

Editing Mapplets:
You can edit a mapplet in the Mapplet Designer. The Designer validates your changes when you save the mapplet. When you save changes to a mapplet, all instances of the mapplet and all shortcuts to the mapplet inherit your changes. If you edit a mapplet after using it in mappings and creating sessions for those mappings, your changes might affect the validity of the mappings and sessions. You can make the following changes to a mapplet without affecting the validity of existing mappings and sessions:
  • Add input or output ports.
  • Change port names or comments.
  • Change Input or Output transformation names or comments.
  • Change transformation names, comments, or properties.
  • Change port default values for transformations in the mapplet.
  • Add or remove transformations in the mapplet, providing you do not change the mapplet type as described in Rule 3, below.

Some mapplet changes can invalidate mappings using the mapplet, such as deleting an output port. To prevent the Informatica Server from trying to run an invalid mapping, the Designer automatically marks a mapping and session invalid if you make certain changes. To prevent the Designer from marking existing mappings and sessions invalid, use the following rules when editing a mapplet in use:
  • Do not delete a port from the mapplet. A port is deleted from a mapplet when you manually delete a connected port from an Input or Output transformation. A port is also deleted when you disconnect a port in an Input or Output transformation from a transformation in the mapplet.
  • Do not change the datatype, precision, or scale of a mapplet port. The datatype, precision, and scale of a mapplet port is defined by the transformation port to which it is connected in the mapplet. Therefore, if you edit a mapplet to change the datatype, precision, or scale of a port connected to a port in an Input or Output transformation, you change the mapplet port itself.
  • Do not change the mapplet type. If you remove all active transformations from an active mapplet, the mapplet becomes passive. If you add an active transformation to a passive mapplet, the mapplet becomes active.

To edit a mapplet:
  • In the Mapplet Designer, drag the mapplet from the Navigator into the workspace.
  • Edit the mapplet as necessary.
  • To prevent invalidating mappings and sessions using the mapplet, follow the rules above.
  • Choose Repository-Save.

Deleting Mapplets:
You can delete an instance of a mapplet from a mapping. You can also delete the mapplet from the repository. When you delete a mapplet, rather than an individual instance, you delete all instances of the mapplet. This invalidates each mapping containing an instance of the mapplet or a shortcut to the mapplet. You can delete a mapplet from the Navigator. You can also delete a mapplet when it is open in the Mapplet Designer. To delete an instance of a mapplet from a mapping:
  • With the mapping open, select the mapplet instance and choose Edit-Delete. You can also press the Delete key.
  • Click OK when the warning appears.
  • Choose Repository-Save.

To delete a mapplet from the repository (from the Navigator):
  • Select the mapplet in the Designer Navigator.
  • Choose Edit-Delete. You can also press the Delete key.
  • Choose Repository-Save.

To delete an open mapplet from the repository:
  • With the mapplet open in the Mapplet Designer, choose Mapplets-Delete.
  • Choose Repository-Save.


Using Mapplets in Mappings:
In a mapping, a mapplet has input and output ports which can be connected to other transformations in the mapping. You do not have to connect all mapplet ports in a mapping. However, the connections you create must complete a logical flow of data for the Designer to validate the mapping.

You can use a mapplet in any mapping in the folder. You can even use the mapplet more than once in a single mapping. Like a reusable transformation, when you drag a mapplet into a mapping, the Designer creates an instance of the mapplet. You can enter comments for the instance of the mapplet in the mapping. You cannot otherwise edit the mapplet in the Mapping Designer. This protects the mapplet from being edited by the user creating the mapping. If you later edit the mapplet, each instance of the mapplet inherits your changes automatically.

For example, you have a mapplet named mpltCalculateNet used in four different mappings. You then edit the mapplet in the Mapplet Designer, adding several output ports and changing the input port names. Each instance of mpltCalculateNet inherits your changes when you save them. Some changes might invalidate the mappings using the mapplet. To use a mapplet, you perform the following steps:
  • Drag the mapplet into the mapping.
  • If a mapplet contains input ports, connect at least one mapplet input port to a transformation in the mapping.
  • Connect at least one output port to a transformation in the mapping.

The connections you create must complete a logical pipeline for the Designer to validate the mapping.

Connecting to Mapplet Input Ports:
When using a mapplet with input ports in a mapping, you connect the mapplet input ports to the mapping pipeline. You can pass data into a mapplet when it originates from a single active transformation. You cannot pass data from two or more active transformations into a mapplet.

Connecting to Mapplets Containing Default SQL Override:
When a mapplet contains a source qualifier that has an override for the default SQL query, you must connect all mapplet output ports to the mapping pipeline. If the mapping does not require all the output from a mapplet, connect all mapplet ports to the next transformation in the mapping, then leave unnecessary ports unconnected from the rest of the mapping.

Connecting to Mapplet Output Groups:
When using a mapplet in a mapping, you connect the mapplet output ports to the mapping pipeline. If a mapplet contains more than one output group, connect ports in each output group to a different pipeline in the mapping. After connecting mapplet output groups to different pipelines in the mapping, you cannot join data in the pipelines. If you need to join the pipelines, you can create two mappings to perform this task:
  • Use the mapplet in the first mapping and write data in each pipeline to separate targets.
  • Use the targets as sources in the second mapping to join data, then perform any additional transformation necessary.