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] Averages and Calculations when using Across

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Averages and Calculations when using Across
 Login/Join
 
Member
posted
I am working with the following:

TABLE FILE V_PREBUY_PIVOT
SUM
SALES_VOLUME_LBS
BY MATERIAL_GROUP
BY MATERIAL_GROUP_DESC
BY SOLD_TO_NAME
BY SHIP_TO_CITY
BY QTY_SHIPPED
BY OPEN_ORDER_LBS
ACROSS BOOK_MONTH AS ''
ON TABLE SUBHEAD
"PreBuy Info"
FOOTING
"&TDATE"
WHERE MATERIAL_GROUP EQ 'PT' AND
(BOOK_MONTH EQ '200807' OR BOOK_MONTH EQ '200808' OR BOOK_MONTH EQ '200809');
ON TABLE SET NODATA ''
ON TABLE SET PAGE-NUM OFF
ON TABLE ROW-TOTAL AS 'TOTAL'
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *

BOOK_MONTH will be an parameter by user. I need a ROW for the AVERAGE of SALES_VOLUME_LBS at the end and the following:

ROW TOTAL: QTY_SHIPPED + OPEN_ORDER_LBS
ROW TOTAL: (QTY_SHIPPED + OPEN_ORDER_LBS) - AVE.SALES_VOLUME_LBS

Does anyone have any suggestions?

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


WebFOCUS 7.6.2 client
WebFOCUS 7.6.0 server
Windows 2000 and 2003 Server.
Windows XP Professional for Dev Studio
Output: HTML, Excel, and PDF
 
Posts: 5 | Registered: September 27, 2007Report This Post
Virtuoso
posted Hide Post
Right after your across you can put in one or more COMPUTE statements.
These can access any column in the report.
This BOOK_MONTH parameter however controls how many columns there will be and thus also how to reference them and how to calculate the average of sales.
What you might do is introduce a multi-verb request. The first part of the request would then calculate the avg of sales for the given months by all other fields (except the across) - NOPRINT. The second part of the request will then contain the normal sum by all fields, this time including the across, after which you can do your computes.
So:
TABLE FILE xxxx
SUM AVG.SALES NOPRINT
BY
BY
BY
SUM SALES
BY
BY
BY
ACROSS
COMPUTE RT1/D12.2 = QTY_SHIPPED + OPEN_ORDER_LBS;
COMPUTE RT2/D12.2 = (QTY_SHIPPED + OPEN_ORDER_LBS) - C1;  

C1 in this case is the very first column, not counting the BY's.
This should give you more or less what you're looking for.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | 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] Averages and Calculations when using Across

Copyright © 1996-2020 Information Builders