May 13, 2005, 02:37 PM
KameshExcel column issue
trying to make the rows as columns in excel.
Ex:
The following is the format of data, I will get from DB.
rowid id detail
row1 1 Sno:1111
row2 1 name:xxxxxx
row3 1 dept:CSE
Need to change this in to column as,
rowid id sno name dept
1 1 1111 xxxxx CSE
Is there any way to do this.
May 16, 2005, 10:38 PM
dwfAre sno, name and dept the only possible labels in detail?
May 17, 2005, 12:28 PM
<JG>Try something along the following lines.
SET HOLDLIST=PRINTONLY
TABLE FILE X1
SUM FST.ROWID
FST.ID
COMPUTE NROWID/A1=IF ID EQ LAST ID THEN NROWID ELSE ROWID;
COMPUTE DETAIL1/A6=IF ROWID EQ '1' THEN DETAIL ELSE ' ';
COMPUTE DETAIL2/A6=IF ROWID EQ '2' THEN DETAIL ELSE ' ';
COMPUTE DETAIL3/A6=IF ROWID EQ '3' THEN DETAIL ELSE ' ';
BY ID NOPRINT
BY ROWID NOPRINT
ON TABLE HOLD FORMAT ALPHA
END
TABLE FILE HOLD
SUM FST.ROWID
MAX.ID
MAX.DETAIL1
MAX.DETAIL2
MAX.DETAIL3
BY ID NOPRINT
END