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
Help with compute ?
 Login/Join
 
Silver Member
posted
I am having trouble with computes. I am new to webfocus and am wrote up the code below. I am trying to calculate some per capita type figures at a summary level. The source data is at the customer detail level and the report is one level higher at the country level. The 'sales per customer' calculation is working fine (it is based on the two summary fields). The calculations based on a summary field and a group by field are not coming out right. Any thoughts ?


DEFINE FILE TEMP
COUNTER/D12 = 1;
END
-*
TABLE FILE TEMP
SUM
COUNTER AS ' Customers '
AND IVC_NET_AMT_USD_TY AS ' Net Sales (USD) - This Fiscal Year (YTD) '

COMPUTE CUSTPERCAP/D12 = (COUNTER / BSEX) ; AS ' Customers per Capita '

COMPUTE SALESPERCAP/D12 = (IVC_NET_AMT_USD_TY / BSEX ) ; AS ' Sales per Capita '

COMPUTE SALESPERCUST/D12 = (IVC_NET_AMT_USD_TY / COUNTER); AS ' Sales per Customer '

BY
DIVISION
BY
BILL_TO_GB_COUNTRY AS ' Country '
BY
BSEX AS ' Population '
-*
ON DIVISION SUBTOTAL
COUNTER
IVC_NET_AMT_USD_TY AS '*TOTAL'
 
Posts: 38 | Registered: May 20, 2004Report This Post
Virtuoso
posted Hide Post
Change your ON DIVISION SUBTOTAL statement to ON DIVISION RECOMPUTE.

SUBTOTAL and SUB-TOTAL do the computes first and then add the vlues in the computed column to get the total.

RECOMPUTE and SUMMARIZE will add the values in the columns first and then apply the computations to the total values in the TOTAL row to get the computed column value for the TOTAL row. I hope this makes sense. It's hard to word the explanation well.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders