Focal Point
[SOLVED] Column titles and percentages

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

September 09, 2009, 05:33 PM
JJ
[SOLVED] Column titles and percentages
Below is a sample code of the report that I am trying to fix. I couldn't figure out how to do couple of things.
1. Is there a way to categorize columns under different titles(they are not across fields)?
For ex: I want to show SEATS and SALES as "Type A"(merge cells on top of SEATS & SALES to show Type A ) and LENGTH, WIDTH, HEIGHT as "Type B"

2. I also wanted to show column percentages along the bottom of column totals. – I tried RECAP but it doesn't show correct percentages.

I appreciate if anybody can help me to achieve this.

-*************
DEFINE FILE CAR
GRANDTOT/I5 = SEATS + SALES + LENGTH + WIDTH + HEIGHT;
END
-**************
TABLE FILE CAR
SUM
GRANDTOT NOPRINT

SUM
COMPUTE ROWTOT/I5 = SEATS + SALES + LENGTH + WIDTH + HEIGHT; NOPRINT
BY COUNTRY

SUM
SEATS
SALES
LENGTH
WIDTH
HEIGHT
BY COUNTRY
ACROSS BODYTYPE AS ''

COMPUTE RTOT/I7 = ROWTOT; AS 'Total by Country'
ON TABLE COLUMN-TOTAL
ON TABLE SET PAGE-NUM OFF
END

This message has been edited. Last edited by: Kerry,


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
September 10, 2009, 11:55 AM
Darin Lee
Check out HEADALIGN and COLSPAN to see if you can get a column title that spans more than a single column. You may also have to add ans AS phrase to the columns.

You could also get creative with your column titles and do something like this:


DEFINE FILE CAR
GRANDTOT/I5 = SEATS + SALES + LENGTH + WIDTH + HEIGHT;
NBODYTYPE/A200=BODYTYPE|'<BR> <BR>&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;TYPE A&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;&|nbsp;TYPE B';
END
-**************
TABLE FILE CAR
SUM
GRANDTOT NOPRINT

SUM
COMPUTE ROWTOT/I5 = SEATS + SALES + LENGTH + WIDTH + HEIGHT; NOPRINT
BY COUNTRY

SUM
SEATS 
SALES 
LENGTH 
WIDTH 
HEIGHT 
BY COUNTRY
ACROSS NBODYTYPE AS ''

COMPUTE RTOT/I7 = ROWTOT; AS 'Total by Country'
ON TABLE COLUMN-TOTAL
ON TABLE SET PAGE-NUM OFF
END


In order to get the percentages to display correctly you need to have and ON TABLE RECOMPUTE.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 10, 2009, 01:50 PM
JJ
Darin,
Thank you for your response. Preferred format for this report is Excel, is there a way to skip a line in Excel headings?

I tried RECOMPUTE with prefix but it doesn't work with this query.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF
September 10, 2009, 02:09 PM
Darin Lee
Are you meaning column titles? Two commas together insert a blank line in a column title.

Not quite sure what you're trying to do with a prefix.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 15, 2009, 03:40 PM
JJ
Darin,
Thank you for all the suggestions, I was able to complete the report using a different method. But the time taken just for aligning total percentages is more than developing 4 new reports and still not aligned properly with column totals. I hope that IBI will introduce a method that can easily calculate and format total column percentages(in Excel) in a future release.


WebFOCUS 8.2.05
Windows 2003
Excel, HTML, PDF