Page 1 of 1

how to transform the given input to output format

Posted: Mon Jun 16, 2008 4:21 am
by rockunder78
hi, can any one give me some idea how to get the below output.

Input

Name,Sal,Month

Hari,2000,Jan

Hari,1000,March

Gokul,3000,Jan

Ganesh,4000,Feb

Jagadish,5000,Jan

Jagadish,6000,Feb



Output

Name, Jan , Feb, March

Hari, 2000, 0 , 1000

Gokul, 3000, 0 , 0

Ganesh , 0 ,4000, 0

Jagadish, 5000,6000, 0

use your pivot

Posted: Mon Jun 16, 2008 4:47 am
by kamesh_sk
use your pivot stage

Posted: Mon Jun 16, 2008 5:25 am
by rockunder78
please guide me how to do in pivot.

Posted: Mon Jun 16, 2008 6:32 am
by chulett
Won't work as the Pivot stage does 'Columns to Rows'. I'd use a hashed file here, keyed by Name where you read and write to it in the same transformer. The first 'miss' gets the whole record written out with two of the three fields set to zero. Each 'hit' after that updates whatever month you are processing.

Afterwards, source from the hashed file to get the final results.