Informatica Scenarios in IICS (Informatica Intelligent Cloud Services):
1. Convert Single Row from Source to Three Rows in Target
- Source: Single row with multiple columns
- Target: Three rows, each with a subset of columns
Solution:
-
Use an Expression Transformation:
- Create three output ports (e.g.,
Target1
,Target2
,Target3
). - For each target port, write expressions to map the desired columns from the source.
- Create three output ports (e.g.,
-
Example: Source has columns
A
,B
,C
. You wantTarget1
to haveA
,Target2
to haveB
, andTarget3
to haveC
.Target1
expression:[Source.A]
Target2
expression:[Source.B]
Target3
expression:[Source.C]
2. Split Non-Key Columns to Separate Tables with Key Column in Both
- Source: Table with key and non-key columns
- Target: Two tables: one with key and all non-key columns, another with just the key
Solution:
- Use a Router Transformation:
- Define the key column(s) as the routing condition.
- Configure one output port for each target table.
3. Separating Duplicate and Non-Duplicate Rows to Separate Tables
- Source: Table with potential duplicates
- Target: Two tables: one for duplicates, another for non-duplicates
Solution:
- Use a Sorter Transformation:
- Sort by the columns that might contain duplicates.
- Use an Expression Transformation:
- Create a flag variable to identify duplicates (e.g.,
IsDuplicate
). - Set
IsDuplicate
totrue
for the first occurrence andfalse
for subsequent occurrences within a group (use previous value ports).
- Create a flag variable to identify duplicates (e.g.,
- Use a Router Transformation:
- Route rows with
IsDuplicate = true
to the "Duplicates" target and others to the "Non-Duplicates" target.
- Route rows with
4. Retrieving First and Last Record from a Table/File
- Source: Table or file
- Target: Two tables: one for the first record, another for the last
Solution:
- Use a Sorter Transformation:
- Sort by a relevant column (e.g., chronological order for a file).
- Use a Filter Transformation:
- Filter for the first record (row number = 1) and last record (row number = total rows).
- Use a Router Transformation:
- Route the first record to the "First Record" target and the last record to the "Last Record" target.
5. Remove Footer from Your File
- Source: File with footer lines
- Target: File without footer lines
Solution:
- Use a Filter Transformation:
- Use an expression to filter out rows based on footer criteria (e.g., pattern matching).
6. Remove Header from Your File
- Source: File with header line(s)
- Target: File without header lines
Solution: (Similar to Scenario 5)
- Use a Filter Transformation:
- Use an expression to filter out rows based on header criteria (e.g., pattern matching).
7. Sending First Half Records to Target
- Source: Table or file
- Target: Table or file with the first half of the data
Solution: (Assuming you know the total number of records)
- Use an Expression Transformation:
- Create a variable to store the total number of records (
TotalRecords
). - Divide
TotalRecords
by 2 to get the number of records in the first half (HalfCount
). - Create another variable (
RowNumber
) using a Sequence Generator Transformation to keep track of the current row. - Filter the rows where
RowNumber
is less than or equal toHalfCount
.
- Create a variable to store the total number of records (
8. Sending Second Half Records to Target
- Source: Table or file
- Target: Table or file with the second half of the data
Solution: (Similar
continue
Continuing Informatica IICS Scenario Solutions:
Here's the continuation of the Informatica IICS scenarios with solutions, incorporating best practices and addressing potential issues:
9. Sending Alternate Records to Target
- Source: Table or file
- Target: Table or file with alternate records
Solution:
- Use an Expression Transformation:
- Create a variable (
IsAlternate
) to track whether the current record is alternate (true
) or not (false
). - Set
IsAlternate
totrue
for the first record and toggle it (true
tofalse
and vice versa) for each subsequent record.
- Create a variable (
- Use a Filter Transformation:
- Filter for rows where
IsAlternate
istrue
.
- Filter for rows where
10. Separate the Original Records in Target
- Source: Table with potentially modified data
- Target: Table with original data from the source
Solution:
- This scenario depends on how the data was modified. If you have a versioning system or log of changes, you might be able to extract the original data from there. Informatica IICS itself doesn't have a built-in mechanism to differentiate original records from modified ones unless those changes are explicitly marked.
11. Separate Rows on Group Basis
- Source: Table with groups identified by a column
- Target: Separate tables for each group
Solution:
- Use a Router Transformation:
- Define the group column as the routing condition.
- Configure a separate output port for each target table (you can dynamically generate port names based on the group value using expressions).
12. Get Top 5 Records to Target without Using Rank
- Source: Table
- Target: Table with the top 5 records
Solution:
- Use a Sorter Transformation:
- Sort by the column you want to use for ranking (e.g., descending for highest values).
- Use a Filter Transformation:
- Limit the
continue
Continuing Informatica IICS Scenario Solutions:
15. Sending Records to Target Tables in Cyclic Order
- Source: Table or file
- Target: Multiple target tables (cyclic distribution)
Solution:
-
Use a Router Transformation with a custom expression for cyclic routing:
Code snippet(iif(mod([RowNumber], num_targets) = 0, num_targets, mod([RowNumber], num_targets)))
- Replace
num_targets
with the actual number of target tables. This expression calculates the target table index based on the current row number (RowNumber
) and the total number of target tables.
- Replace
16. Concatenation of Duplicate Values by Comma Separation
- Source: Table with potential duplicates
- Target: Table with concatenated duplicate values separated by commas
Solution:
- Use a Sorter Transformation:
- Sort by the column(s) that might contain duplicates.
- Use an Aggregator Transformation:
- Group by the non-duplicate columns.
- Use a CONCAT aggregation function (with a comma separator) on the duplicate column.
17. Target Table Rows, with Each Row as Sum of All Previous Rows from Source Table
- Source: Table with numeric values
- Target: Table with each row containing the sum of all previous rows in the source
Solution:
- Use an Expression Transformation:
- Create a variable (
RunningTotal
) with an initial value of 0. - In the expression for each target column, add the source value to
RunningTotal
and assign the result to the target column. - Update
RunningTotal
with the new sum for the next row.
- Create a variable (
18. Produce Files as Target with Dynamic Names
- Source: Table or file
- Target: Files with dynamic names based on source data
Solution:
- Use an Expression Transformation:
- Create an expression to generate the desired file name based on source data (e.g., concatenating columns or using a timestamp).
- Use a Set Target File Properties Transformation:
- Set the "Filename" property dynamically using the expression from step 1.
19. Validating All Mappings in Repository
- Functionality: Validate mappings for errors or inconsistencies
Solution:
Informatica IICS doesn't have a single "validate all mappings" functionality. However, you can achieve partial validation by:
- Using the lineage view to identify potential issues (e.g., missing source or target connections).
- Running individual mappings in test mode to identify technical errors during data transformation.
20. Using Mapping Parameter and Variable in Mapping
- Functionality: Define and use parameters and variables within a mapping
Solution:
- Parameters:
- Define parameters in the mapping properties for reusable values.
- Use parameter references within expressions (e.g.,
[myParam]
).
- Variables:
- Create variables within the Expression Transformation for temporary calculations.
- Use variable names in expressions after assigning values.
**21. Removing '' symbols
- Target: Table with the '' symbol from the source salary value.
22. Currency Converter
- Source: Table with currency values
- Target: Table with converted currency values
Solution:
- Use an Expression Transformation with a custom currency conversion expression or a built-in IICS function (if available). You might need additional information like source and target currencies and exchange rates.
23. Sending Data One After Another to Three Tables in Cyclic Order
- Source: Table or file
- Target: Three target tables with data in cyclic order
Solution: (Similar to Scenario 15)
- Use a Router Transformation with a cyclic routing expression for three targets.
**24. Converting '' symbols
- Target: Table with the '' with 'RS.'.
25. Insert and Reject Records Using Update Strategy
- Functionality: Insert successful records and handle errors for rejected records
**Solution