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     [SOLVED] TOTAL row is wrong?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] TOTAL row is wrong?
 Login/Join
 
Platinum Member
posted
Hey Folks,

I just noticed something strange on the TOTAL row of a tabular report. I have 5 columns in this report. The first is hidden for sorting purposes, the second is just textual, the others are all numbers. I show the total for those three number columns. The 3rd and 5th are fine, but the 4th is showing a negative number. It makes no sense, because there are no negative numbers in that column. Moreover, if I run it as an active report and calculate the sum for the 4th column (by left clicking the column and selecting Calculate > Sum), then it calculates it correctly. Any idea why the total row is showing a negative number? And the number doesn't seem to make sense either, like its not the correct sum multiplied by -1 either, just seems to be a random negative number.

Here is the code:
TABLE FILE COST_OF_CALLS
SUM
     CNT.DST.CALL_SOURCE_KEY/D12 AS 'Calls'
     COMPUTE RESPONSE_TIME/D9C = DIFSEC/60/60; AS 'Total,Hours'
     COST_ON_CALLS/D12M AS 'Cost of,Calls'
  BY TOTAL HIGHEST COST_ON_CALLS NOPRINT
  BY BY_DISPLAY AS '&BY_DISPLAY_TITLE'

WHERE MONTH_YEAR EQ '&MONTH_YEAR'
ON TABLE SUMMARIZE
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET LINES 700
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
GRAPHTYPE=DATA,
     COLUMN=N5,
$
TYPE=TITLE, COLUMN=N3, JUSTIFY=RIGHT,$
TYPE=TITLE, COLUMN=N4, JUSTIFY=RIGHT,$
TYPE=TITLE, COLUMN=N5, JUSTIFY=RIGHT,$
END


I realize you will not be able to run that code, sorry. But it might be helpful.

Also, in case this is important, the 4th column shows -579,182 on the TOTAL row. When I do Calculate > Sum, I get 613,871.


Thanks folks!

This message has been edited. Last edited by: Shingles,


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 190 | Registered: May 19, 2017Report This Post
Platinum Member
posted Hide Post
Might this be an overflow issue? Doesn't seem like the right way to deal with overflows though...


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 190 | Registered: May 19, 2017Report This Post
Platinum Member
posted Hide Post
NVM... it was an overflow issue. I moved the COMPUTE to a define and then things were great!


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 190 | Registered: May 19, 2017Report This Post
Expert
posted Hide Post
You know the difference between a COMPUTE and a DEFINE ?

COMPUTEs are evaluated after aggregation and sorting (but before TOTAL)
DEFINEs are evaluated at time of data retrieval.

This is important depending on the calculation you need.

So your DIFSEC field when calculated in a COMPUTE will be summed before the /60/60.

Also D fields are handled differently to other numeric fields like P fields.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Yes, I was aware... just forgot.


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 190 | Registered: May 19, 2017Report This Post
Expert
posted Hide Post
I know what you mean.

So much to remember. Smiler


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
I did remember in the end though... anyways... thanks Waz!


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 190 | Registered: May 19, 2017Report This Post
Expert
posted Hide Post
Could any of your DIFSEC values be nulls?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     [SOLVED] TOTAL row is wrong?

Copyright © 1996-2020 Information Builders