Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
Would you like to see a separate forum on Baanboard for the ION product?
No
14%
Yes
86%
Total votes: 80

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 1st June 2012, 10:45
forstner forstner is offline
Newbie
 
Join Date: Jan 2012
Posts: 2
forstner is on a distinguished road
Baan: Baan IV - DB: SQL Server - OS: Windows 2003
report: wrong sum with aggregate function
Baan: Baan IVc4
C/S: None/Unknown

Hello,

I have a strange problem. I have a report with the Layouts Before.report, Detail and After.report. In the After.report Layout i have 4 fields where i use the aggregate function (the domain is tc mcs.double and all field settings are the same). 3 of these fields show the correct sum, but one shows a false sum. The sum is almost twice of the amount it should be (but not exactly). Any ideas what the reason could be?

Thanks in advance!
Reply With Quote
  #2  
Old 1st June 2012, 15:23
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Just put the report in debug mode and step through it. But first - I would check that the data is getting to the report correctly. Make sure there is nothing in the report script that might impact the field. The run a small amount of data - check what gets read into the field and what happens as you step through the report.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 4th June 2012, 10:29
günther günther is offline
Guru
 
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 502
günther is on a distinguished road
Baan: IVc4 - DB: Informix - OS: HP-UX
Also have a look at the field "Where (Expr)" right to the file "Aggregate Function". Maybe these differ.

Günther
Reply With Quote
  #4  
Old 4th June 2012, 11:24
forstner forstner is offline
Newbie
 
Join Date: Jan 2012
Posts: 2
forstner is on a distinguished road
Baan: Baan IV - DB: SQL Server - OS: Windows 2003
Hi Mark,

Thank you. I found the problem:

sum.hrea.cost = sum.hrea * (ticpr150.wgrt + ticpr150.mcrt + ticpr150.ohrt)

aiu = sum.hrea.cost + mitmcost

if aiu = 0 and aiu.null = tcyesno.no then
lattr.print = false
endif

sum.hrea.cost, mitmcost and aiu have value 0 and sum.hrea not. Does that mean when lattr.print = false is used i have to set all values to 0 when i use the aggregate function? With other words the aggregate function will sum the value even the line is not printed?
Reply With Quote
  #5  
Old 4th June 2012, 14:17
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If I understand correctly then yes when you set lattr.print to false then yes you might need to set the variables to zero. Since I do not know the report or the script I can't be sure. Or as Gunther mentioned - maybe add a where clause to the aggregate itself.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong line printed in report alexpreyer Tools Development 3 30th June 2010 15:42
Page x of y: Kevin Brock's solution. ~Vamsi Code & Utilities 4 5th January 2006 11:08
report function "need()" spartacus Tools Development 9 30th July 2004 03:21
xml question steveauckly Tools Development 4 27th July 2004 10:41
Total Aggregate Function? Eddie Monster Tools Development 1 8th March 2002 18:33


All times are GMT +2. The time now is 17:55.


©2001-2013 - Baanboard.com - Baanforums.com