Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Trying to have totals (subtotals?) above detail lines in report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Trying to have totals (subtotals?) above detail lines in report
 Login/Join
 
Guru
posted
In Mainframe FOCUS, I am developing a report where I wish to have one or two lines of record information, including totals for some fileds, and then I want to have detail lines print below this total line.

How might I get totals or subtotals into the subhead line and then print the detail lines below this line?

Thank you in advance, and looking forward to any and all replies.

This message has been edited. Last edited by: webmeister,


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Create two hold files, one with the details and one with the subtotals.
Add an extra by field in both hold files. Say 'A' for the subtotals and 'B' for the details.
Combine the two hold files to one and create a report on the combined hold file with the extra field as first (invisible) sort field .

Based on that same field you can get the subtotals bold or cursive.




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, 2006Report This Post
Platinum Member
posted Hide Post
try this example:
 
SET ASNAMES=ON
TABLE FILE CAR
SUM FUEL_CAP   AS 'TOTAL_FUEL_CAP'
BY COUNTRY
ON TABLE HOLD AS HOLD1
END
TABLE FILE CAR
PRINT FUEL_CAP AS 'DETAIL_FUEL_CAP'
BY COUNTRY
BY CAR
BY MODEL
ON TABLE HOLD AS HOLD2
END
MATCH FILE HOLD1
PRINT TOTAL_FUEL_CAP
BY COUNTRY
RUN
FILE HOLD2
PRINT DETAIL_FUEL_CAP
BY COUNTRY
BY CAR
BY MODEL
AFTER MATCH HOLD OLD-OR-NEW
END
TABLE FILE HOLD
PRINT   
      DETAIL_FUEL_CAP
BY COUNTRY
BY CAR
BY MODEL
ON COUNTRY SUBHEAD
" Total Fuel Cap for <COUNTRY is <TOTAL_FUEL_CAP "
ON COUNTRY SKIP-LINE
END 


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Virtuoso
posted Hide Post
You can use prefix operators with fields in subheads so somthing like the following should get what you want.
TABLE FILE CAR
SUM CAR RCOST DCOST
BY COUNTRY
BY CAR
ON COUNTRY SUBHEAD
"Total for Country <COUNTRY <ST.RCOST <ST.DCOST"
ON COUNTRY SUBFOOT
" "
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=SUBHEAD, COLOR='RED',$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=4,POSITION=RCOST,$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=6,POSITION=DCOST,$
$
ENDSTYLE
END


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, 2007Report This Post
Virtuoso
posted Hide Post
On second thought, that won't get correct totals. Try this instead:
DEFINE FILE CAR
RCOST1/D9C=RCOST;
DCOST1/D9C=DCOST;
END
TABLE FILE CAR
SUM RCOST1 WITHIN COUNTRY NOPRINT
 DCOST1 WITHIN COUNTRY NOPRINT
CAR RCOST DCOST
BY COUNTRY 
BY CAR NOPRINT
ON COUNTRY SUBHEAD
"Total for Country <COUNTRY <ST.RCOST1 <ST.DCOST1"
ON COUNTRY SUBFOOT
" "
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=SUBHEAD, COLOR='RED',$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=4,POSITION=RCOST,$
TYPE=SUBHEAD, BY=1, LINE=1, ITEM=6,POSITION=DCOST,$
$
ENDSTYLE
END


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, 2007Report This Post
Expert
posted Hide Post
Darin,

I tried that and it doesn't work. ST. only picks up the first entry for the sort field.

WM could do what the other posts said or maybe try a multi-verb request.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
Yup - caught that. See my last post


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, 2007Report This Post
Platinum Member
posted Hide Post
darin - that works. nice.


WF 8 version 8.2.04. Windows.
In focus since 1990.
 
Posts: 189 | Location: pgh pa | Registered: October 06, 2004Report This Post
Guru
posted Hide Post
To all of you for responding and suggesting so quickly, a big thank you! I'll put those suggestions into my project...and it should work. I had my head wrapped too tightly into the project and could not see the forest for the trees.

Again, thank you!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Remember that SUBHEAD always takes the values of inserted data from the first line of the sortgroup. So one can do away with DEFINEs and use a plain multi-set request:

  
TABLE FILE CAR
SUM RCOST NOPRINT DCOST NOPRINT
BY COUNTRY
PRINT RCOST DCOST
BY COUNTRY
ON COUNTRY SUBHEAD
"<COUNTRY<RCOST<DCOST"
ON COUNTRY SUBFOOT
" "
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=SUBHEAD, HEADALIGN=BODY, $
TYPE=SUBHEAD, ITEM=2, JUSTIFY=RIGHT, $
TYPE=SUBHEAD, ITEM=3, JUSTIFY=RIGHT, $
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, 2006Report This Post
Virtuoso
posted Hide Post
And something more. In 7.6.7 there is a new SET command:
  
SET DUPLICATECOL={ON | OFF}


And the example in the documentation (page 43, 767snf.pdf):
Displaying Reports With Multiple Display Commands
The following request sums current salaries and education hours for the entire EMPLOYEE
data source and for each department:
TABLE FILE EMPLOYEE
SUM CURR_SAL ED_HRS
SUM CURR_SAL ED_HRS BY DEPARTMENT
END
With DUPLICATECOL=ON, the output has separate columns for the grand totals and for the
departmental totals:
   CURR_SAL ED_HRS DEPARTMENT     CURR_SAL ED_HRS
   -------- ------ ----------     -------- ------
$222,284.00 351.00 MIS         $108,002.00 231.00
                   PRODUCTION  $114,282.00 120.00
With DUPLICATECOL=OFF, the output has one column for each field. The grand totals are
on the top row of the report, and the departmental totals are on additional rows below the
grand totals:
DEPARTMENT     CURR_SAL ED_HRS
----------     -------- ------
            $222,284.00 351.00
MIS         $108,002.00 231.00
PRODUCTION  $114,282.00 120.00


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, 2006Report This Post
Virtuoso
posted Hide Post
A nice found Danny, in fact the SET DUPLICATION add something you can compare with a multiverb report.




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, 2006Report This Post
Virtuoso
posted Hide Post
Yes, and there is a styling attribute called VERBSET to style each set of a multi-set request differently.

See: http://documentation.informationbuilders.com/masterinde...f/source/topic43.htm


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, 2006Report This Post
Guru
posted Hide Post
Danny,

Thanks for replying, however.... we are an archaic FOCUS site, running FOCUS 7.1, and the DUPLICATECOL will not therefore help. If you have another idea or two, I would love to hear them, but it would have to be for an older release of mainframe FOCUS.

Thanks again,


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
Maybe working out my suggestion will help you a bit.

SET ASNAMES=ON 
DEFINE FILE CAR
GROUPCODE/A1='A';
DCAR/A10='';
DMODEL/A10='';
END
TABLE FILE CAR
SUM FUEL_CAP 
BY GTOUPCODE
BY COUNTRY 
BY DCAR AS CAR
BY DMODEL AS MODEL 
ON TABLE HOLD AS HOLD1 
END 
DEFINE FILE CAR
GROUPCODE/A1='B';
END
TABLE FILE CAR 
PRINT FUEL_CAP 
BY GROUPCODE
BY COUNTRY 
BY CAR 
BY MODEL 
ON TABLE HOLD AS HOLD2 
END
-RUN
TABLE FILE HOLD1
PRINT *
ON TABLE HOLD AS HOLD3
MORE
FILE HOLD2
END
-RUN
TABLE FILE HOLD3
PRINT FUEL_CAP 
BY GROUPCODE NOPRINT
BY COUNTRY 
BY CAR 
BY MODEL 
END



This will give you the totals on the first line and then the details .

If you want a subtotal too, you can create a 3th HOLD file for that.




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, 2006Report This Post
Guru
posted Hide Post
Thanks, Frank,

I'll play around with that and incorporate it into what someof the other folks have suggested.

Thank you to all who responded and offered your help!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Master
posted Hide Post
Try this:
 
DEFINE FILE CAR
TTL_CST/D12.2=DEALER_COST;
TTL_SLS/D12.2=SALES;
END
TABLE FILE CAR
SUM 
TTL_CST NOPRINT
TTL_SLS NOPRINT
BY COUNTRY
PRINT DEALER_COST SALES
BY COUNTRY 
BY CAR
ON COUNTRY SUBHEAD
"TOTAL <TTL_CST <TTL_SLS"
END
 


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Trying to have totals (subtotals?) above detail lines in report

Copyright © 1996-2020 Information Builders