Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT ??/

Status
Not open for further replies.

rose70

Programmer
Jul 4, 2004
15
CA
appreciate if anybody can help me with the row to column conversion. Like for exampleIn a single row I have something like this.

TABLE SOURCEE
EMPID-------------SAL
101 3000
101 4000
101 4200
101 5000
102 3200
102 3800
102 4200
102 4800
103 3100
103 3700
103 4300
....
AND I WANT LIKE THIS TARGET TABLE
EMPID--------sal1998------sal1999------sal2000------
101 3000 4000 4200 5000
102 3200 3800 4200 4800
103 3100 3700 4300 4900
THANKS
 
This is the reverse of the normalizing action. You can get proper result with the use of an expression transformation followed with an aggregator.

Define outgoing ports in expression transformation as:

IIF(YEAR = 1998,SAL,0)
IIF(YEAR = 1999,SAL,0)
IIF(YEAR = 2000,SAL,0)
......................
IIF(YEAR = 2004,SAL,0)

Send these outgoing ports to an aggrgator and perform a min or max aggragation with the group by on the EMPID. That will get all data back into one row for each EMPID

T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top