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.
I'm sure I've seen a way to do this, but I cannot remember. I would like to average a field only where that field above a certain value. Something like this: TABLE FILE SPORTS SUM AVE.SCORE AS 'OVERALL AVERAGE' AVE.SCORE AS 'REAL AVG' (WHERE SCORE GT 15) BY MONTH WHERE SPORT EQ 'FOOTBALL'; ON TABLE HOLD AS H1 END
It's the 2nd average score that I can't seem to figure out. I am not creating any subtotals here.
WF (App Studio) 8.2.01m / Windows Mainframe FOCUS 8
DEFINE FILE SPORTS
SCORE15/I8=IF SCORE GT 15 THEN SCORE ELSE 0;
END
TABLE FILE SPORTS
SUM
AVE.SCORE AS 'OVERALL AVERAGE'
AVE.SCORE15 AS 'REAL AVG'
BY MONTH
WHERE SPORT EQ 'FOOTBALL';
ON TABLE HOLD AS H1
END
I haven't test this but it might give you some ideas. However, it might affect the average as it would average in the zeroes.
You might have to also count the number that are not zero and use that as the denominator in a COMPUTE.
Play around with it and see what you come up with.
adding to Ginny's code: DEFINE FILE SPORTS SCORE15/I8 MISSING ON=IF SCORE GT 15 THEN SCORE ELSE MISSING; END TABLE FILE SPORTS SUM AVE.SCORE AS 'OVERALL AVERAGE' AVE.SCORE15 AS 'REAL AVG' BY MONTH WHERE SPORT EQ 'FOOTBALL'; ON TABLE HOLD AS H1 END
Then you would only get the average of those that had values and ignore the rest.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
By default, when you do a DEFINE it will always have either a value as determined by the expression or a blank for alpha or 0 for numeric. The addition of the MISSING ON on the left side of the expression allows a DEFINEd field to be null or missing. Glad you found what you needed. Ya'll come back soon for more(another word I learned at Summit this year!)
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007