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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
subtotal in subhead
 Login/Join
 
Platinum Member
posted
I found a few posts on this, but I couldn't get the suggestions to work. One said that st. would work in the subhead, but I get bogus results (I don't get a subtotal, I get a single line value). I need to have 2 different subheads with a subtotal in them with detail below the lowest subhead.

I also tried to do a multi-pass (is that what it's called) and calculate the fields with a sum but I don't get the correct amounts in there either. So, I'm way out on left field on this one. It should be simple, but I'm not getting it.

I replicated with the car file as best I could.

So, if I'm using the car example, I would want to know the total number of seats for a bodytype and then also the total number of seats for that country. So, if there were 3 convertibles in England with 2 seats and 2 sedans in England with 4 seats, you would see

Total Seats England 14
Total Seats for bodytype Convertables 6
Total Seats for bodytype Sedans 8

There would be detail below each bodytype listing what the details of each convertible and sedan was.

Any suggestions?

I forgot to put some of my code out here:

SET ASNAMES=ON
TABLE FILE CAR
SUM COMPUTE CNTBODY/I8=IF BODYTYPE EQ LAST BODYTYPE THEN CNTBODY+SEATS ELSE SEATS;
BY BODYTYPE
SUM COMPUTE CNTCNTRY/I8=IF COUNTRY EQ LAST COUNTRY AND BODYTYPE EQ LAST BODYTYPE THEN CNTCNTRY+SEATS ELSE SEATS;
BY BODYTYPE
BY COUNTRY
PRINT SEATS
BY BODYTYPE
BY COUNTRY

ON BODYTYPE SUBHEAD
"TOTAL BODY SEATS
ON COUNTRY SUBHEAD
"TOTAL COUNTRY SEATS
ON TABLE PCHOLD FORMAT EXL2K
END

This message has been edited. Last edited by: Pam Kratt,


webfocus 8.105M; os: windows; pdf, html, exl2k, csv
 
Posts: 179 | Registered: November 10, 2004Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
SEATS2/I3=IF (SEATS EQ 2) THEN SEATS ELSE 0;
SEATS4/I3=IF (SEATS EQ 4) THEN SEATS ELSE 0;
SEATSA/I3=SEATS;
END
TABLE FILE CAR
SUM SEATS2 SEATS4 SEATSA
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON COUNTRY SUBFOOT
"Total Seats <COUNTRY <ST.SEATSA"
"Total Seats Convertables <ST.SEATS2"
"Total Seats Sedans <ST.SEATS4"
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
Sumfing like this?

TABLE FILE CAR
SUM
SEATS NOPRINT
BY COUNTRY NOPRINT
BY BODYTYPE NOPRINT

ON COUNTRY SUBFOOT
"TOTAL SEATS <COUNTRY <ST.SEATS"
" "

ON BODYTYPE SUBFOOT 
"TOTAL SEATS BODYTYPE <BODYTYPE <ST.SEATS"
WHEN BODYTYPE EQ 'SEDAN'

ON BODYTYPE SUBFOOT 
"TOTAL SEATS BODYTYPE <BODYTYPE <ST.SEATS"
WHEN BODYTYPE EQ 'CONVERTIBLE'

ON BODYTYPE SUBFOOT 
"TOTAL SEATS BODYTYPE <BODYTYPE <ST.SEATS"
WHEN BODYTYPE EQ 'HARDTOP'

ON BODYTYPE SUBFOOT 
"TOTAL SEATS BODYTYPE <BODYTYPE <ST.SEATS"
WHEN BODYTYPE EQ 'COUPE'

ON BODYTYPE SUBFOOT 
"TOTAL SEATS BODYTYPE <BODYTYPE <ST.SEATS"
WHEN BODYTYPE EQ 'ROADSTER'

END


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Mickey, we need the subtotals in the subhead. When I change your code to be subhead instead of subfoot, I get completely different totals.


webfocus 8.105M; os: windows; pdf, html, exl2k, csv
 
Posts: 179 | Registered: November 10, 2004Report This Post
Virtuoso
posted Hide Post
DEFINE FILE CAR
SEATS2/I3=IF (SEATS EQ 2) THEN SEATS ELSE 0;
SEATS4/I3=IF (SEATS EQ 4) THEN SEATS ELSE 0;
SEATSA/I3=SEATS;
END
TABLE FILE CAR
SUM SEATS2 SEATS4 SEATSA
BY COUNTRY
SUM SEATS
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON COUNTRY SUBHEAD
"Total Seats <COUNTRY <SEATSA"
"Total Seats Convertables <SEATS2"
"Total Seats Sedans <SEATS4"
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Platinum Member
posted Hide Post
Thanks ... I modified slightly because I needed the second subhead and the below gave me what I needed. That's for the ideas because I would have never gotten this without your suggestions!

DEFINE FILE CAR
SEATS4/I3=SEATS;
SEATSA/I3=SEATS;
END
TABLE FILE CAR
SUM SEATSA
BY COUNTRY
SUM SEATS4
BY COUNTRY BY CAR
SUM SEATS
BY COUNTRY BY CAR BY MODEL BY BODYTYPE
ON COUNTRY SUBHEAD
"Total Seats ON CAR SUBHEAD
"Total Seats END


webfocus 8.105M; os: windows; pdf, html, exl2k, csv
 
Posts: 179 | Registered: November 10, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders