Focal Point
[CLOSED] subtotal formula not correct

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

April 25, 2013, 11:07 AM
Karen Paulsen
[CLOSED] subtotal formula not correct
I have a report that has several columms. While most of the columns (let's say A-F)are coming directly from the table, I have one column (let's call this one G) that I am calculating a value based on the values in the other columns (a-F); it is a complex formula that has a series of if/then/else. Then I have another column (we'll call this one H) that calculates the % of (column D) divided by the calculated column (G). So all is going well..... until I want to throw some sub totals into the report.

What I want to happen is to sum columns a-g and then recalculate the value in column H based on the sub total amounts. I can't find a way on a sub total line to recalculate some of the columns and sum the rest. HELP!

I tried to move my calculation into the master file, but now when I run the report the % column on the sumary row is using the value from the last detail row in the calculation instead of using the sub totals from the sub total row.

Been researching this way to look and still can not come up with a solution...PLEASE HELP>

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Excel, PDF, HTML
April 25, 2013, 11:25 AM
Francis Mariani
Look into SUMMARIZE and RECOMPUTE (used instead of SUBTOTAL and SUB-TOTAL)

Creating Reports With WebFOCUS Language > Including Totals and Subtotals > Recalculating Values for Subtotal Rows:

SUMMARIZE - Recomputes values at every sort break.
RECOMPUTE - Recalculates values only at the specified sort break.

SUB-TOTAL - displays a subtotal when the sort field changes value, and for any higher-level sort fields when their values change.
SUBTOTAL - displays a subtotal only when the specified sort field changes value. It does not give subtotals for higher-level fields.


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
April 26, 2013, 10:40 AM
Danny-SRL
Karen, Francis,

RECOMPUTE won't work because it will apply the G-calculation at total time, whereas you want to total G and recalculate F.
So, forget about SUTOTAL or RECOMPUTE and use SUBFOOT:
for those fields that you want to sum enter them in the SUBFOOT as
<ST.A<ST.B...<ST.G

for the H use a RECAP before the SUBFOOT, recalculate G as TOTG and enter if also in the SUBFOOT as
<ST.A<ST.B...<ST.G<TOTG

Good luck!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 28, 2013, 02:12 PM
FrankDutch
An other solution might be found in FML
This gives you a spreadsheet like functionality so you can calculate in between columns rows and do different calculations as you might do in excel or lotus (does that still excist)




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

April 29, 2013, 09:51 AM
George Patton
Yes Frank, Not only does the Lotus Notes Symphony spreadsheet still exist, but it is excellent. IBM did a lot of work on the Open Office spreadsheet and gave it a very nice user interface. The whole office suite is available for free on the IBM website. Recently IBM donated all the code to the Apache Foundation who are doing the next release of Open Office. I'm looking foward to seeing the Symphony UI on that.

Finally, I'm happy to report that the Symphony spreadsheet plays very nicely with WebFocus 7704.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP