Focal Point
Strange behaviour with SUBTOTAL
December 04, 2006, 04:07 PM
Francis MarianiStrange behaviour with SUBTOTAL
TABLE FILE CAR
SUM
SALES/D15M
MIN.DEALER_COST/D15M
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL SALES DEALER_COST
END
The subtotal for DEALER_COST is not displayed - it should.
TABLE FILE CAR
SUM
SALES/D15M
MIN.RETAIL_COST/D15M
MIN.DEALER_COST/D15M
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL SALES DEALER_COST
END
The subtotals work as expected.
TABLE FILE CAR
SUM
SALES/D15M
MIN.DEALER_COST/D15M
MIN.RETAIL_COST/D15M
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL SALES DEALER_COST
END
The subtotal for DEALER_COST is not displayed - it should. The subtotal for RETAIL_COST is displayed - it should not.
TABLE FILE CAR
SUM
SALES
MIN.DEALER_COST
MIN.RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL SALES DEALER_COST
END
The subtotals work as expected.
What's up?
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 05, 2006, 03:23 AM
Tony AFrancis,
Sounds like a "feature" to me
and I think you should call it in.
For info the Dealer Cost subtotal only gets displayed in your last example on 7.1.3. Retail Cost subtotal never gets displayed in any of the examples.
T
In FOCUS since 1986 | WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2 | | |
WebFOCUS App Studio 8.2.06 standalone on Windows 10 | |
December 05, 2006, 09:37 AM
Francis MarianiThe problem probably has to do with the internal matrix.The engine is likely getting confused by the MIN. and/or the /D15M - three columns instead of one.
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 05, 2006, 10:56 AM
ETTaking out the field references in the on phrase also works (at leasst on MVS 7.11).
TABLE FILE CAR
SUM
SALES/D15
MIN.DEALER_COST/D15
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL
END
FOCUS 7.6 MVS PDF,HTML,EXCEL
December 05, 2006, 11:08 AM
Francis MarianiET, that works on 5.3.2 as well, but I need to specify which columns to subtotal.
Thanks,
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 05, 2006, 12:28 PM
mgrackinFrancis,
When using a reformat option on a field (such as D15M) focus will create a new column in the internal matrix with the new format. The original field (DEALER_COST) basically gets a NOPRINT stuck onto it since you want the field with the new format to print. Since the original field gets a NOPRINT this affects the SUBTOTAL statement as well. I'm not quite sure why it works some of the time but this is basically what is happening internally and is affecting your report. Try creating a DEFINE field with the new format and then applying the MIN. to the DEFINE field in the report. You could also try creating a COMPUTE field and then SUBTOTALing that instead.
The following example demostrates both techniques.
DEFINE FILE CAR
NEWDEAL/D15M=DEALER_COST;
END
TABLE FILE CAR
SUM
SALES/D15M
MIN.NEWDEAL
MIN.DEALER_COST NOPRINT
COMPUTE DEALCOST/D15M=MIN.DEALER_COST;
MIN.RETAIL_COST/D15M
BY COUNTRY
BY CAR
BY MODEL
ON CAR SUBTOTAL SALES NEWDEAL DEALCOST
END
Thanks!
Mickey
| FOCUS/WebFOCUS 1990 - 2011 |
December 05, 2006, 01:25 PM
Francis MarianiMickey, thanks for your suggestions.
As I mentioned in another thread, people using the GUI to generate code wouldn't have a clue about all these work-arounds.
Cheers,
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 05, 2006, 04:45 PM
mgrackinFrancis,
The GUI can be used to create the worked around DEFINE but of course, as you said, you would need to know that you had to do the work around in the first place.
Thanks!
Mickey
| FOCUS/WebFOCUS 1990 - 2011 |