Focal Point
Traspose Columns

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3391032961

May 24, 2006, 01:41 PM
jammer
Traspose Columns
I Have a report like this

Class Amount1 Amount2
A 100 300
B 200 400
------------------------------------------------------------

I want to transpose the table so I get a report like this

Heading > Class A

Amount1 100
Amount2 300

Heading > Class B

Amount1 200
Amount2 400

---------------------------------------------------------

I tried using "accross" and the best I got was

Amount1
100 300
Amount2
200 400
----------
A B

which is not really what I want
--------------------------------------------------------

Any suggestions?


Webfocus 7.6.4
Windows 2003 Server, SQL Server 2005
Excel, HTML , JavaScript ,and PDF.
Reportcaster, BID, Tomcat
May 24, 2006, 02:10 PM
Prarie
Is this what you want?

TABLE FILE CAR
SUM SALES RETAIL_COST
BY CAR NOPRINT
ON CAR SUBHEAD
" CAR'"
" "
END


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
I think this is the idea that you want:

FILEDEF HDATA DISK HDATA.DAT (APPEND

SET PAGE-NUM = OFF

DEFINE FILE CAR
LABEL/A20 = 'AMOUNT1';
AMOUNT/D7 = DEALER_COST;
END

TABLE FILE CAR
PRINT 
LABEL
AMOUNT
BY CAR
BY MODEL
ON TABLE HOLD AS HDATA FORMAT ALPHA
END

DEFINE FILE CAR
LABEL/A20 = 'AMOUNT2';
AMOUNT/D7 = RETAIL_COST;
END

TABLE FILE CAR
PRINT 
LABEL
AMOUNT
BY CAR
BY MODEL
ON TABLE HOLD AS HDATA FORMAT ALPHA
END

TABLE FILE HDATA
PRINT 
AMOUNT AS ''
BY CAR NOPRINT
BY MODEL NOPRINT
BY LABEL AS ''

ON MODEL SUBHEAD
" <CAR : <MODEL "

END



Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
Yes smiths - that was what I was looking for. thanks!

I simplified my report - I was afraid I had to do something like that - I actually have 8 amounts - so I need to do 8 of those reports of HDATA.


Webfocus 7.6.4
Windows 2003 Server, SQL Server 2005
Excel, HTML , JavaScript ,and PDF.
Reportcaster, BID, Tomcat
Would a simple OVER not do.
  
TABLE FILE CAR
PRINT DEALER_COST AS 'Dealer Cost'
 OVER RETAIL_COST AS 'Retail Cost'
 OVER SEATS       AS 'Seats'
 OVER LENGTH      AS 'Length'
 OVER WIDTH       AS 'Width'
 OVER HEIGHT      AS 'Height'
 OVER WEIGHT      AS 'Weight'
 OVER WHEELBASE   AS 'Wheel Base'
 OVER FUEL_CAP    AS 'Fuel Cap'
 OVER BHP         AS 'Brake Horse Power'
 OVER RPM         AS 'Revs/Minute'
 OVER MPG         AS 'Miles/Gallon'
BY MODEL NOPRINT 
ON MODEL SUBHEAD
" "
"<MODEL>"
END
-RUN

This message has been edited. Last edited by: <JG>,
Ya, I agree JG, much simpler...forgot about that one!

Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
yes - thats better (or in developer studio field option - newline (over))


Webfocus 7.6.4
Windows 2003 Server, SQL Server 2005
Excel, HTML , JavaScript ,and PDF.
Reportcaster, BID, Tomcat