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] Weighted Average calculation on total line

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Weighted Average calculation on total line
 Login/Join
 
Member
posted
Hi,
I want total of a count and weighted calculation of age to be on the total line.
Please find below a query similar to my request.

TABLE FILE CAR
SUM
CNT.SEATS
AVE.WHEELBASE
BY CAR
WHERE CAR IN ('TOYOTA', 'BMW', 'AUDI')
ON TABLE SUBTOTAL SUM. SEATS AVE. WHEELBASE
END

RESULT:
CAR CNT WHEELBASE
AUDI 1 105.3
BMW 6 102.7
TOYOTA 1 93.3
TOTAL 8 100.4

Here on the total line I am getting a total of count of seats and average of average of wheelbase. Instead I want to get total of count of seats and weighted average of wheelbase on the total line.
Is there any formula to calculate weighted average on subtotal? or any other way to achieve the requirement.

Please help. Confused

This message has been edited. Last edited by: Kathleen Butler,


Supriya
WF 7.7.02/8.0
 
Posts: 18 | Registered: November 16, 2011Report This Post
Virtuoso
posted Hide Post
Sladkat,

How do you define your weighted average?
I would use a COMPUTE instead of AVE and do RECOMPUTE instead of a SUBTOTAL.


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
 TABLE FILE CAR
SUM
  CNT.SEATS
  SUM.WHEELBASE AS SUM,WHEELBASE NOPRINT
  COMPUTE AVG/D10.2=SUM.WHEELBASE/CNT.SEATS; AS 'AVE,WHEELBASE'
BY CAR
WHERE CAR IN ('TOYOTA', 'BMW', 'AUDI')
ON TABLE SUMMARIZE
END
 
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
It worked... Thanks a lot Smiler


Supriya
WF 7.7.02/8.0
 
Posts: 18 | Registered: November 16, 2011Report 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] Weighted Average calculation on total line

Copyright © 1996-2020 Information Builders