As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a procedure where I want to subtotal some columns at a particular sort level so I used SUBTOTAL. Some of the columns are directly from the database and they are subtotaled correctly. Some of the rows are computed values and they are subtotaled correctly. One of the rows is subtotaled incorrectly since that column a margin value and it is adding it up (this is like an average so it should not be added - it should be recalculated). Changed SUBTOTAL to RECOMPUTE to correct this and it did for that row and also the other rows that came directly from the database but the rows that are computed values are all way to high (not subtotaled correctly). I can't seem to get this to work althought I've tried 50 combinations of SUBTOTAL and RECOMPUTE. I guess what I'd like to do is SUBTOTAL some rows and RECOMPUTE others but it seems that the RECOMPUTE overrides the SUBTOTAL or maybe that's a coincedence. Any ideas?
TABLE FILE EISBOD PRINT ORD AS 'Order' PRS7/P8C AS 'Pairs' VALSOLD/P10C AS 'Total Sales' COMPUTE TOTALSOLDEXT/D10C = SP * PRS7; NOPRINT COMPUTE TOTALCOSTEXT/D10C = ( TOTSTDCST * PRS7 ); AS 'Total Cost' COMPUTE TOTALMARGIN/D10C = ( ( SP - TOTSTDCST ) * PRS7 ); AS 'Total Margin' COMPUTE MarginPct/D7.2% = ( ( TOTALSOLDEXT - TOTALCOSTEXT ) / TOTALSOLDEXT ) * 100; AS 'Margin%' BY CUSTNAME AS 'Customer' BY LOGOP AS 'Logo' BY PAT AS 'Product' BY ACS AS 'FOB' BY TOTSTDCST AS 'Landed' BY SP AS 'Selling Price' BY TOTAL COMPUTE MarginPrice/D7.4 = SP - TOTSTDCST; AS 'Margin/Price'
ON CUSTNAME SUBTOTAL AS '*TOTAL '
ON LOGOP SUBTOTAL AS '*TOTAL' HEADING "Margin By Pattern" ON TABLE SUBFOOT " " "&DATEMDYY<+0> <+0>&TOD<+0> <+0>&FOCFEXNAME" WHERE TOTSTDCST NE 0; WHERE COMP EQ &Company.(FIND COMP IN EISBOD).Company.; WHERE SLSNAME EQ '&SalesmanName.(FIND SLSNAME IN EISBOD).Salesman Name.'; WHERE RPTDATE GE '&FromDate.From Date.'; WHERE RPTDATE LE '&ThruDate.Thru Date.'; WHERE LF EQ '&LF.(OR(FIND LF IN EISBOD)).LF.'; WHERE STSCD EQ '&StsCd.(OR(FIND STSCD IN EISBOD)).Status Code.'; ON TABLE SET PAGE-NUM OFF ON TABLE SET POPUPDESC ON ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT HTML
The column titled "Margin %' is the row I need recomputed.
The column titled "Total Cost" is an example of a subtotal that gives a way high number when RECOMPUTE used.This message has been edited. Last edited by: JDroke,
________________________________________________________________________________________ WebFOCUS 7.6.8 + Windows Server 2003 + DB2/400
Posts: 66 | Location: Nashville, TN, USA | Registered: January 16, 2008
I didn't go through your example carefully, but will when I get a minute. Have you tried SUMMARIZE to see if you get what you need?
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
How high is "too high" ? Can you tell what it IS doing with it ? For example, does it look more like a "GRAND TOTAL" ?
You may be able to bury them both in DEFINE statements, or functions, to make them appear the same way to either "SUBTOTL" or "SUMMARIZE" or "RECOMPUTE" ?
SP and TOTSTDCST are rates, are defined at the lowest sort level. But since they do not involve a COMPUTE formula, the values used in the COMPUTEs are the sum of their detail values.
Try using a ratio in these computes, something like
JD, SUBTOTAL and RECOMPUTE are exclusive and if you use both the last operation will prevail. Your only option is to use SUBFOOT and a RECAP for the recalculation of your "margin". See an example using the CAR file:
TABLE FILE CAR
PRINT
RETAIL_COST
DEALER_COST
SALES
COMPUTE PROFIT/D9 = SALES * ( RCOST - DCOST );
COMPUTE RATIO/F6.2 = DCOST / RCOST;
BY COUNTRY
BY CAR
ON COUNTRY RECAP
CRATIO/F6.2 = DCOST / RCOST;
ON COUNTRY SUBFOOT
"Total <COUNTRY<ST.RCOST<ST.DCOST<ST.SALES<ST.PROFIT<CRATIO"
ON TABLE NOTOTAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=ON,
FONT='TIMES NEW ROMAN',
SIZE=10,
$
TYPE=SUBFOOT, HEADALIGN=BODY, JUSTIFY=RIGHT, $
TYPE=SUBFOOT, ITEM=1, JUSTIFY=LEFT, $
TYPE=SUBFOOT, ITEM=2, JUSTIFY=LEFT, $
ENDSTYLE
END
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
Since you are PRINTING all the lines, I would put the computed fields in a DEFINE first. COMPUTE in the TABLE is only necessary if you working with SUM. The last suggestion from Danny should do the job.
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
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006