Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

converting rows to columns;

$
0
0

Hi,

I am trying to convert a row organised table into a column table, I know I might want to use pivot or reverse pivot, but am not able to achieve it.

 

Source table

 

ROW_ID     VALUE     VALUE_2

1                    ADD          TX

2                    DELETE     TX

3                   UPDATE     TX

4                   NA              TX

1                    ANNA        USER_ID

2                    BONEY      USER_ID

3                   CATHY       USER_ID

4                   DENNIS     USER_ID

5                    EMILY        USER_ID

6                    FRANCIS        USER_ID


I would want the target table to look like


TX               USER_ID

ADD               ANNA

DELETE          BONEY

UPDATE          CATHY

NA                    DENNIS

                         EMILY

                         FRANCIS



VALUE and VALUE_2 columns are independent and the ROW_ID column is only just a incremental counter for the TX and the USER_ID.

Also the number of rows for TX and USER_ID is dynamic and can be in the range of 100's.



How can I achoeve this? Can someone help me with step by step approach?


Cheers!


Am using Designer version 14.2.2


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>