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     help computing totals

Read-Only Read-Only Topic
Go
Search
Notify
Tools
help computing totals
 Login/Join
 
Platinum Member
posted
I was trying to get some help computing an average in the totals line (without using RECAP) for my report. I am currently using:
ON TABLE RECOMPUTE AVE. FIELDNAME.

But I need the average to only compare values where it does not equal zero. So if the 5 row values are 0 1 1 1 1 the average should be 1 not .8 .

If this is possible any help would be great, thanks.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Platinum Member
posted Hide Post
Eric,

I think this might be the idea you are looking for:

DEFINE FILE CAR
CNT/I4 = IF SALES EQ 0 THEN 0 ELSE SEATS;
END

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
SEATS 
COMPUTE SOMEAVG/I5 = IF CNT EQ 0 THEN 0 ELSE SALES/CNT;

WHERE COUNTRY EQ 'ITALY'

ON TABLE RECOMPUTE AND SUB-TOTAL

END



Regards,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
Platinum Member
posted Hide Post
I may have said it wrong, but I need column totals for that specific row. The results of the code you posted are (with sales showing an average in the column total instead of summed totals):

COUNTRY CAR MODEL SALES SEATS SOMEAVG
ITALY ALFA ROMEO 2000 4 DOOR BERLINA 4800 4 1200
ITALY ALFA ROMEO 2000 GT VELOCE 12400 2 6200
ITALY ALFA ROMEO 2000 SPIDER VELOCE 13000 2 6500
ITALY MASERATI DORA 2 DOOR 0 2 0
TOTAL 7550 10 3775

Where 7550 is ther average sales of 4800,12400,13000,0. I need that number to say 10066 which is the average of 4800,12400,13000.


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report This Post
Platinum Member
posted Hide Post
Then just simplify it to this...

  
DEFINE FILE CAR
CNT/I4 = IF SALES EQ 0 THEN 0 ELSE 1;
END

TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
SALES
COMPUTE SOMEAVG/I5 = IF CNT EQ 0 THEN 0 ELSE SALES/CNT;

WHERE COUNTRY EQ 'ITALY'

ON TABLE RECOMPUTE AND SUB-TOTAL

END



------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
 
Posts: 210 | Location: Ottawa | Registered: November 03, 2005Report This Post
Platinum Member
posted Hide Post
It worked, I would never have thought of that ... Thanks smiths!


dev: WF 7.6.5 w/IIS + Tomcat

prod: WF 7.6.5 w/IIS + Tomcat
 
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006Report 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     help computing totals

Copyright © 1996-2020 Information Builders