# Pivot Grid Default Aggregation

**URL:** <https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [May 15, 2019, 3:24pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520 "2019-05-15T15:24:31Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 15, 2019, 3:24pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/1 "2019-05-15T15:24:31Z")

</div>

In TDP 5.0, the default aggregation seems to be "count" instead of "sum". Is there any way to change the default?  
 ![pivot](https://global.discourse-cdn.com/quest/original/2X/1/18c062d9e4ef7a6568e3b648f566e99eddaf26ac.jpeg)

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 16, 2019, 2:56am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/2 "2019-05-16T02:56:40Z")

</div>

Currently the default aggregate for number types is sum. What is the datatype of this field in the database or it is result of calculated field or function? It from calculated field for function we have no way of easily knowing the return type.

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 16, 2019, 6:25am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/3 "2019-05-16T06:25:36Z")

</div>

The datatype for the field in the database is numeric(14,2)

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 16, 2019, 2:52pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/4 "2019-05-16T14:52:03Z")

</div>

What database type?

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 16, 2019, 3:13pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/5 "2019-05-16T15:13:54Z")

</div>

SQL Server 2016

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 17, 2019, 2:55am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/6 "2019-05-17T02:55:25Z")

</div>

I can't seem to reproduce. Let me have someone else take a look.

---

<div class="post-metadata">

**Author:** ![Cindy.Sang](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Cindy.Sang](https://forums.toadworld.com/u/Cindy.Sang)\
**Post date:** [May 17, 2019, 6:49am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/7 "2019-05-17T06:49:43Z")

</div>

TDP show count as default if row type is string. QAT-14837 is made to change it

Cindy

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 17, 2019, 7:03am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/8 "2019-05-17T07:03:43Z")

</div>

It seems to be dependent on the fields in the row area.

In this screen shot with just the deduction code in the row area, it shows the row and columns totals as a sum which is the desired behavior.

 ![](https://global.discourse-cdn.com/quest/original/2X/9/95d1ec3df41e335ee506b99a322ad1b23c8c9fd6.png)

If I add employee id as the first row area column, it shows a count for the employee id instead of sum and the grand total row is not displayed even though show  
row totals is enabled.. The grand total column is still a sum.

 ![](https://global.discourse-cdn.com/quest/original/2X/d/d06ee5a49dbf7bd97475d3b0ba0dd40ab2aeea2b.png)

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 17, 2019, 11:16pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/9 "2019-05-17T23:16:20Z")

</div>

> [@Cindy.Sang](#):
>
> QAT-14837

We will add this info to QAT-14837

---

<div class="post-metadata">

**Author:** ![Cindy.Sang](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Cindy.Sang](https://forums.toadworld.com/u/Cindy.Sang)\
**Post date:** [May 20, 2019, 2:41am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/10 "2019-05-20T02:41:32Z")

</div>

- Grand total is not the same with subtotal, at beginning "Robinson, Steven S, Count" it's subtotal, since "Robinson Steven S" is a string, TDP show count not sum for this field, QAT-14837 will resolve it

- if you add employee id as the first row area column, it show count also --- Could you check "employee id" datatype? if string, that's the issue QAT-14837

- "Row total" and "Column total" can by invoked by r-click Data Grid "show Row(Column )totals"

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 20, 2019, 4:42pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/11 "2019-05-20T16:42:13Z")

</div>

Employee id is also a string datatype char(5)

---

<div class="post-metadata">

**Author:** ![Cindy.Sang](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Cindy.Sang](https://forums.toadworld.com/u/Cindy.Sang)\
**Post date:** [May 21, 2019, 2:48am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/12 "2019-05-21T02:48:45Z")

</div>

then that's the case QAT-14837

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [May 31, 2019, 3:55pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/13 "2019-05-31T15:55:01Z")

</div>

Is there a scheduled date for when this issue will be corrected?

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [May 31, 2019, 4:50pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/14 "2019-05-31T16:50:12Z")

</div>

> [@Cindy.Sang](#):
>
> QAT-14837

It is scheduled for TDP 5.0.6 but no one has started work on it. So no guarantee.

---

<div class="post-metadata">

**Author:** ![Filip.Cevela](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/filip.cevela/32/200_2.png) [@Filip.Cevela](https://forums.toadworld.com/u/Filip.Cevela)\
**Post date:** [June 17, 2019, 2:53pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/15 "2019-06-17T14:53:38Z")

</div>

Hi Steve,

I started to work on this item but it doesn't make sense to me. Can you little bit more describe to me what you want to do?  
I can switch default value from COUNT to SUM for char/varchar/text values but it doesn't make sense because it always be 0. Pivot never convert your data but just use datatype from your database. You can modify your SQL and do conversion here if needed.

Filip

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [June 17, 2019, 4:29pm UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/16 "2019-06-17T16:29:44Z")

</div>

Filip, you're correct we want to switch the default subtotals from COUNT to SUM. The totals won't be zero since it's summing the values in the row area which are numeric. Let me know if this makes sense.

---

<div class="post-metadata">

**Author:** ![Filip.Cevela](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/filip.cevela/32/200_2.png) [@Filip.Cevela](https://forums.toadworld.com/u/Filip.Cevela)\
**Post date:** [June 19, 2019, 10:51am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/17 "2019-06-19T10:51:37Z")

</div>

Hi Steve, thanks for additional information I just missed part that you want to change it for default **subtotal** values.  
I already changed it and we will test it now.  
Filip

---

<div class="post-metadata">

**Author:** ![steve.robinson](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@steve.robinson](https://forums.toadworld.com/u/steve.robinson)\
**Post date:** [June 25, 2019, 12:57am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/18 "2019-06-25T00:57:12Z")

</div>

Hi Filip, I just tested this issue in 5.0.6.95 and it appears the default aggregation is still count instead of sum.

---

<div class="post-metadata">

**Author:** ![Debbie\_Peabody](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/debbie_peabody/32/18_2.png) [@Debbie\_Peabody](https://forums.toadworld.com/u/Debbie_Peabody)\
**Post date:** [June 25, 2019, 3:27am UTC](https://forums.toadworld.com/t/pivot-grid-default-aggregation/46520/19 "2019-06-25T03:27:18Z")

</div>

That is correct. That fix is not in 5.0.6.95. It has been coded but is in testing and will be in 5.0.7
