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     [CLOSED] Unable to find the Average of a Field(By field)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Unable to find the Average of a Field(By field)
 Login/Join
 
Member
posted
Hi,
I need to calculate & display a Average field column next to the Count of the Dep column in the code given below.So when I just run this code,I will get 5 columns(say M,N,O,P,Q) printed across ABC field.My average calculation is based on these 5 columns :
Avg=((M*5)+(N*4)+(O*3)+(P*2)+(Q*1))/Sum(Q:M)
Does anyone knows how to do this.Any help would be greatly appreciated.Thanks.

Below is my code :
TABLE FILE HOLDDP
SUM
CNT.DEP
BY ID
BY NAME
BY REG
BY SUBR
BY RMD_YR
BY RMD_DT
BY SLS
BY SLD_Q
ACROSS ABC
ACROSS XYZ
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD1
END
-RUN

This message has been edited. Last edited by: <Kathryn Henning>,
 
Posts: 24 | Registered: July 16, 2010Report This Post
Expert
posted Hide Post
What about something like this, though I don't see how that computation is an average:

TABLE FILE CAR
SUM
CNT.LENGTH
COMPUTE AVG/D10 = ( (WEIGHT*5) +(LENGTH*4) + (HEIGHT*3) +(WHEELBASE*2) + (FUEL_CAP*1) ) / WEIGHT + LENGTH + HEIGHT + WHEELBASE + FUEL_CAP;

BY COUNTRY
ACROSS SEATS
ACROSS BODYTYPE
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
Virtuoso
posted Hide Post
You post this two times.
Maybe remove the second one to avoid mistakes




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
Member
posted Hide Post
Hi Susannah,
I tried using your method but unfortunately it always throws the below error message in this line of the code : numerator/D20=ABC * factor;.
(FOC281)Alpha arguments in place where numeric are called for

I tried changing the format to A4 and even to I4 but of no use.[Just as an fyi...The format if the across field ABC is A4 in my code]
Any help on how to get this resolved is greatly appreciated.This is really urgent to me.
Thanks a lot in advance!


webfocus 769,windows 7,html
 
Posts: 24 | Registered: July 16, 2010Report This Post
Virtuoso
posted Hide Post
I would buy a manual and read that
Get some basic training
And read all the answers ppl post here.




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
Expert
posted Hide Post
info4pals, Please delete one of these 2 posts, this post or that post.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
I think what Frank was trying to say is, that it should be obvious that you cannot do a mathmatical calculation on an Aplha field (A4). That is what the error message is telling you. Both fields need to be numeric. ACROSS is a bit trickier than BY, so there are already a lot of postings about it in this forum. If you can't find the answer already posted, we need to see all of your code (defines and everything) or an equivalent example written using the CAR data that comes with the WebFocus product.


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
 
Posts: 103 | Registered: April 27, 2011Report This Post
Expert
posted Hide Post
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report 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     [CLOSED] Unable to find the Average of a Field(By field)

Copyright © 1996-2020 Information Builders