# Calculations with aggregates

**URL:** <https://forum.servoy.com/t/calculations-with-aggregates/7086>\
**Category:** Classic Servoy\
**Created:** [February 13, 2007, 12:52pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086 "2007-02-13T12:52:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tweetie](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tweetie](https://forum.servoy.com/u/tweetie)\
**Post date:** [February 13, 2007, 12:52pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086/1 "2007-02-13T12:52:04Z")

</div>

Please see attachment.  
All columns are aggregates except for the right one.  
The darkgrey row is a subsummary.  
The white row is a other subsummary.  
The left light grey column (SVJ) is a total of column 1-12 of year 2006  
The right light grey column (SDJ) is a total of column 1-12 of year 2007  
The light grey columns are aggregates.

The right column is a calculation based on aggregates:

```auto
return Math.round((sdj-svj)/svj*100)/100;
sdj en svj are aggregates

```

How come that some of the circled calculation shows nothing?  
It should be showing:  
-100,00%  
+300,00%  
-47,00%  
-100,00%  
-43,00%

Servoy Developer  
Version R2 2.2.7-build 339  
Java version 1.5.0\_11-b03 (Windows 2003)

 ![Java-Printing.gif](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/e/e08096dda226b5dfd2e7184218af9e8328071898.gif)

---

<div class="post-metadata">

**Author:** ![tweetie](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tweetie](https://forum.servoy.com/u/tweetie)\
**Post date:** [February 21, 2007, 7:04pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086/2 "2007-02-21T19:04:12Z")

</div>

I really need your help on this one…guys.  
I am having huge unexpected behaviour with aggregates.

The grey and underlined rows are subsummarys…see the attachments

2 columns with aggregates are summing stuff that isn’t there.

I am at loss here. I have redone the form over and over and I can get seem to solve the problem

Is this a bug? Is there a maximum amount of aggregates on a form??  
I am pretty experienced with aggregates…but this one is illuding me

Many thankx in advance

Servoy Developer  
Version R2 2.2.7-build 339  
Java version 1.5.0\_11-b03 (Windows 2003)

 ![printoutput.gif](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/0/01edb82ab50ffe669339808937c9d6b7b475efb2.gif)

 ![aggregations.gif](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/453805ac521125e12e80da5080af6e120202535c.gif)

 ![layout.gif](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/125e2081d956ba1e10ef57a18ff8c1082ee8975c.gif)

---

<div class="post-metadata">

**Author:** ![IT2Be](https://avatars.discourse-cdn.com/v4/letter/i/dc4da7/32.png) [@IT2Be](https://forum.servoy.com/u/IT2Be)\
**Post date:** [February 21, 2007, 7:20pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086/3 "2007-02-21T19:20:54Z")

</div>

Obviously it is hard to give you ‘the’ answer but could it be that you have null values in there? I have experienced some circumstances that did no good in that case. Do you do a check on that?

---

<div class="post-metadata">

**Author:** ![tweetie](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tweetie](https://forum.servoy.com/u/tweetie)\
**Post date:** [February 21, 2007, 8:10pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086/4 "2007-02-21T20:10:45Z")

</div>

> IT2Be:  
> Obviously it is hard to give you ‘the’ answer but could it be that you have null values in there? I have experienced some circumstances that did no good in that case. Do you do a check on that?

Yeah a lot of the fields have null values…Gonna put in some 0’s then  
Thanx

---

<div class="post-metadata">

**Author:** ![tweetie](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@tweetie](https://forum.servoy.com/u/tweetie)\
**Post date:** [February 21, 2007, 8:40pm UTC](https://forum.servoy.com/t/calculations-with-aggregates/7086/5 "2007-02-21T20:40:28Z")

</div>

Okay the removal of null values…solved the aggregate problem. Thankx Marcel.  
Still the calculations of percentages are not working properly.

Does anyone know if there is a format…where the form doesn’t show 0 (zero’s) ?

In Filemaker there was a neat solution for that.

The reports is now filled with a lot of zero’s, making it a bit unreadable.
