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] "TABLE RECOMPUTE" problem with the empdata sample

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] "TABLE RECOMPUTE" problem with the empdata sample
 Login/Join
 
Member
posted
Dear Comunity

I have a strange problem concerning the "TABLE RECOMPUTE" statement in the following report.
What I expect from WF is that on the "Total" row WF also calculates the averages for the column "AVE1" and "DISPDATE". But nothing shows up there. Is this a bug or do I something wrong?

Any help is appreciated.

Thanks for your help and time.

Best regards
Matt



DEFINE FUNCTION SEC_TIME/A20 (DIFF_SEC/D12.2)
SEC_PER_HR/I5= 60 * 60;
SEC_PER_DAY/I5= SEC_PER_HR * 24;
DAYS/I3= IF DIFF_SEC LT SEC_PER_DAY THEN 0 ELSE DIFF_SEC/SEC_PER_DAY ;
-*GET THE DIFF IN WHOLE HOURS
HOURS/I2=( DIFF_SEC - (DAYS * SEC_PER_DAY)) / SEC_PER_HR;
MINT/I2= ( DIFF_SEC - (DAYS * SEC_PER_DAY) - (HOURS * SEC_PER_HR))/60 ;
SEC/I2 = DIFF_SEC - (DAYS * SEC_PER_DAY) - (HOURS * SEC_PER_HR) - MINT * 60;

DISP_TIME/A8= EDIT(HOURS)|':'|EDIT(MINT)|'.'|EDIT(SEC);
SEC_TIME/A20 = FTOA(DAYS,'(F3)','A3') | ' ' | 'Days ' | DISP_TIME;
END

DEFINE FILE ibisamp/empdata
-* CREATING DATE TIME FIELDS FOR TEST (NEXT FOUR LINES)
TIME1/A20= IF DEPT EQ 'ACCOUNTING' THEN '2005/12/20 12:30:05' ELSE
IF DEPT EQ 'SALES' THEN '2005/01/01 09:25:27' ELSE
IF DEPT EQ 'MARKETING' THEN '2005/10/03 09:25:27' ELSE
'2005/02/02 10:15:00'; TIME2/A20= IF DEPT EQ 'ACCOUNTING' THEN '2005/12/21 20:23:04' ELSE
IF DEPT EQ 'SALES' THEN '2005/01/04 10:25:37' ELSE
IF DEPT EQ 'MARKETING' THEN '2005/10/07 11:25:27' ELSE
'2005/02/09 18:15:03';
DATE_TIME1/HYYMDSA= HINPUT(20,TIME1,10,'HYYMDS');
DATE_TIME2/HYYMDSA= HINPUT(20,TIME2,10,'HYYMDS');
DIFF_SEC/D12.2= HDIFF(DATE_TIME2, DATE_TIME1, 'SECOND', 'D12.2');
DISPDATE/A20 = SEC_TIME(DIFF_SEC);
END

TABLE FILE IBISAMP/EMPDATA
SUM
COMPUTE A/D12.2=TOT.DIFF_SEC;
COMPUTE B/D12.2=CNT.DIFF_SEC;
COMPUTE C/D12.2=TOT.DIFF_SEC/CNT.DIFF_SEC;
AVE.EMPDATA.EMPDATA.DIFF_SEC
COMPUTE AVE1/A20 = SEC_TIME(C);
BY EMPDATA.EMPDATA.DEPT
PRINT
EMPDATA.EMPDATA.DISPDATE
BY EMPDATA.EMPDATA.DEPT
BY EMPDATA.EMPDATA.LASTNAME
ON TABLE RECOMPUTE
ON TABLE SET HTMLCSS ON
END

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 26 | Location: Switzerland | Registered: August 17, 2016Report This Post
Virtuoso
posted Hide Post
You can specify column names in TOTAL.

Something like this:
ON TABLE RECOMPUTE SUM. Fieldname1 AVE. Fieldname2 AS 'Total:'


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
samatthias,

Your function return an alpha string (A20).
An average cannot be performed on an alpha.

Same reason for DISPDATE.

Focus needs number to perform an average.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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] "TABLE RECOMPUTE" problem with the empdata sample

Copyright © 1996-2020 Information Builders