Skip to Content
0
Former Member
Jul 22, 2009 at 02:11 AM

Transpose data from Rows to columns (Charac Model to Key Figure Model)

560 Views

Hi

We are trying to transpose fields in our routine.

Basically we wanted to move from rows to columns

Eg:

Source Data

Compacy Code Flag Amount

2000 1 5000

2001 1 500

2002 1 50

2000 2 1000

2001 2 100

2002 2 10

What I wanted in my DSO finally , Company code is Primary Key

Company Code Amount1 Amount2

2000 5000 1000

2001 500 100

2002 50 10

Logic for Amoutn1 : When Flag value is 1 then update the result with Amount

Logic for Amoutn2 : When Flag value is 2 then update the result with Amount

What happens in our case is the last record for each primary key is only coming and overwriting in my DSO.

We tried rule groups but no luck ; may be we are missing something.