A reusable expression transformation to generate sequence numbers which resets, when there is a change in the value of keys as in a control break.
While you can use the inbuilt Sequence Generator transformation in most situations, it cannot be configured to reset the generated sequence based on external conditions. For example, when a value in the current row is different from the value in a previous row, you may like to reset the Sequence number. This is a typical control break scenario when there is a change in the value of one of the keys on which a file is sorted which requires a sequence reset.
This reusable Expression will increment or reset a counter (sequence number) based on an input port's value. The counter will increment when a chosen input port's current row is equal to the previous row and reset the counter when the current row's value does not match the value from a previous row.
I work in Technology for a U.S. company. I have over 20 years experience working in information technology. I currently work with Informatica PowerCenter and Informatica Data Quality in an SAP, Unix, DB2 environment.