Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] TOTAL row is wrong?
Go
New
Search
Notify
Tools
Reply
  
[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: 188 | Registered: May 19, 2017Reply With QuoteReport 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: 188 | Registered: May 19, 2017Reply With QuoteReport 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: 188 | Registered: May 19, 2017Reply With QuoteReport 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: 6291 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Yes, I was aware... just forgot.


WebFOCUS 8201, SP 0.1, Windows 7, HTML
 
Posts: 188 | Registered: May 19, 2017Reply With QuoteReport 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: 6291 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport 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: 188 | Registered: May 19, 2017Reply With QuoteReport 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: 5687 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] TOTAL row is wrong?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.