Page 1 of 1

Rows into Columns

Posted: Mon Jun 15, 2009 6:15 pm
by vcamsgc
For Every unique key column value, i need to get the 1st NotNull values of every column based upon the source priority.

SOURCE File:

Key Source Col1 Col2

2000 A NULL DEF
2000 B NULL NULL
2000 C XYZ NULL

2001 A PQR NULL
2001 C NULL RXB
2001 D OIO ABC

2002 A NULL NULL
2002 B IOP NULL
2002 C NULL NULL
2002 D KEF ABE

TARGET output like below.

2000 A XYZ DEF
2001 A PQR RXB
2002 A IOP ABE


Thanks
Vcamsgc

Posted: Mon Jun 15, 2009 8:13 pm
by ray.wurlod
Welcome aboard.

This is most easily accomplished, once data have been sorted by the key, in a Transformer stage using stage variables to detect whether a non-null value has already been processed for the current key. As many rows are output as are input, into a Remove Duplicates stage that allows only the last row from each group to pass.

Posted: Tue Jun 16, 2009 12:45 pm
by vcamsgc
ray.wurlod wrote:Welcome aboard.

This is most easily accomplished, once data have been sorted by the key, in a Transformer stage using stage variables to detect whether a non-null value has already been processed for the current key. As many rows are output as are input, into a Remove Duplicates stage that allows only the last row from each group to pass.

how to check not null values passed or not in particular column for group of key values?

Posted: Tue Jun 16, 2009 4:39 pm
by ray.wurlod
IsNull() function, IsNotNull() function, NullToValue() function, to name just three.