Focal Point
Totals for Across column using formatting on the fly

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

November 05, 2009, 12:48 PM
EED
Totals for Across column using formatting on the fly
Your tips on formatting on the fly solved a big problem when I want to print numbers and associated dollars ACROSS some codes ACROSS type(# or $).

The problem is that my ON TABLE COLUMN-TOTAL the across field that is either # or $ is formatted 1 way or the other seemingly without reference to that particular column's format. Is there any way to control the format of the column on the subtotal or total so that it matches the values in that particular column?


WebFOCUS 7.6.11
Windows
Excel, PDF, HTML, csv
November 05, 2009, 01:12 PM
Francis Mariani
I've never noticed that behaviour. We love sample code on this forum, so if you can put together an example of what you describe, we can try to work it out. Use one of the sample data files, like CAR, or GGSALES.

Have you tried ACROSS-TOTAL instead? Here's code you can run:

TABLE FILE CAR
SUM
SALES/D10M
RETAIL_COST/P10C
ACROSS COUNTRY 
ACROSS-TOTAL

BY SEATS

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
TYPE=REPORT, SQUEEZE=ON,
FONT='ARIAL', SIZE=8,
$
ENDSTYLE
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 05, 2009, 02:38 PM
EED
ACROSS-TOTAL doesn't really get the total I want. Here's an example based on CAR.

DEFINE FILE CAR
SALESFLG/A1 = IF COUNTRY EQ 'ENGLAND' THEN 'N' ELSE 'Y';
AMOUNT/D12.2 = IF SALESFLG EQ 'Y' THEN SALES ELSE RETAIL_COST;
END

TABLE FILE CAR
SUM
COMPUTE MYFMT/A8 = IF SALESFLG EQ 'Y' THEN 'D12.2M' ELSE 'D12.2C'; NOPRINT
AMOUNT/MYFMT AS 'Amount'
ACROSS COUNTRY
BY SEATS

ON TABLE COLUMN-TOTAL AMOUNT
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT

The point is that within the across some columns will always be amounts that should be displayed with $ and others will be identical size numbers (D12.2) which should be displayed without $. The individual rows hold the formatting on the fly perfectly but the formatting on the totals seems to depend on whether or not the last row has a value in that column, and I cannot count on that.


WebFOCUS 7.6.11
Windows
Excel, PDF, HTML, csv
November 05, 2009, 04:42 PM
Francis Mariani
The format is based on a row value SALESFLG, which is not available on the total row, how would you like the format to be determined for the total row?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
November 05, 2009, 05:45 PM
EED
What I'd really like is having it based on the values of the Across names. So in the example based on the value of Country. Don't know if that's possible. In my case I have multiple ACROSS statements that enforce a sort order value that's constant but the number of the subsort values within the sort groupings are unknown.


WebFOCUS 7.6.11
Windows
Excel, PDF, HTML, csv
November 18, 2009, 03:00 PM
Kerry
Hi EED,

I passed this one to FOCUS people and was told that it cannot be done in the way you want it.

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.