Focal Point
Subtotaling RPCT. columns

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

December 19, 2007, 01:40 PM
hiredgun
Subtotaling RPCT. columns
Is there any way to get RPCT. columns to subtotal correctly? I've tried SUMMARIZE and RECOMPUTE and all I get are the sums of the percentages. What I want, of course, are the percentages for the subtotal rows.

TABLE FILE CAR
SUM SEATS
RPCT.SEATS/D8.2%
BY COUNTRY SUMMARIZE
ACROSS BODYTYPE
END

SET SUMMARYLINES has no effect. Is there some option or command I'm missing? I'll appreciate any and all help.


Test: Win 7 SP1, Dev Studio 8.0.07, SQL Server 2K8, PDF, EXL2K
Prod: Win 2K3/8, WF 7.7.02m, SQL Server 2K5/2K8, PDF, EXL2K
December 19, 2007, 03:15 PM
Francis Mariani
Unfortunately, I don't think you're missing an option or command - rather, it is WebFOCUS that is missing something!

Here's one way - calculate the percentage:

TABLE FILE CAR
SUM SEATS NOPRINT
BY COUNTRY
SUM SEATS
COMPUTE SEATSPCT/D8.2% = SEATS / C1 * 100; AS '%'
BY COUNTRY SUMMARIZE
ACROSS BODYTYPE
END

I hope someone proves me wrong, but the only other way would be to use FRL to resolve this simple task.


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
December 19, 2007, 04:03 PM
mgrackin
Francis is correct. SUMMARIZE/RECOMPUTE do not recalculate the RPCT. prefix on the total lines. Just for fun I tested the MAX. prefix operator and the same is true for this one as well. It seems the prefix operators are calculated as the internal matrix is being built or at some interim level before COMPUTEs. This is probably why they cannot act like or be treated as true COMPUTE fields which are affected correctly by SUMMARIZE/RECOMPUTE.

I suggest using Francis' technique.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
December 20, 2007, 04:20 AM
FrankDutch
And if you don't like the use of the column coding (C1) you can create an extra field SEATS1 and use that in the code like

DEFINE FILE CAR
SEATS1=SEATS;
END

TABLE FILE CAR
SUM SEATS1 NOPRINT
BY COUNTRY
SUM SEATS
COMPUTE SEATSPCT/D8.2% = SEATS / SEATS1 * 100; AS '%'
BY COUNTRY SUMMARIZE
ACROSS BODYTYPE
END





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

December 20, 2007, 12:04 PM
hiredgun
Thank you very much. This was exactly what I needed. I was hoping I was missing something that didn't require a lot of extra coding - and I was. Although I don't mind the column technique, I'll make it easier for someone else who may have to maintain my code at some later date and be more explicit. Thanks again Francis, Mickey, and Frank.


Test: Win 7 SP1, Dev Studio 8.0.07, SQL Server 2K8, PDF, EXL2K
Prod: Win 2K3/8, WF 7.7.02m, SQL Server 2K5/2K8, PDF, EXL2K