# Label Functions

**URL:** <https://forums.toadworld.com/t/label-functions/6891>\
**Category:** Toad Data Point & Toad Intelligence Central\
**Created:** [September 29, 2011, 10:19am UTC](https://forums.toadworld.com/t/label-functions/6891 "2011-09-29T10:19:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![spatel\_093](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@spatel\_093](https://forums.toadworld.com/u/spatel_093)\
**Post date:** [September 29, 2011, 10:19am UTC](https://forums.toadworld.com/t/label-functions/6891/1 "2011-09-29T10:19:07Z")

</div>

Is there anyway to use labels in Toad Reports to calculate new labels? I have a label that sums the sales and i would like to take that label and divide it by another label.

---

<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:** [September 29, 2011, 2:36pm UTC](https://forums.toadworld.com/t/label-functions/6891/2 "2011-09-29T14:36:13Z")

</div>

You should be able to add a cqalulcated field in the Data Report. Use the right click menu in the Field list area.

Debbie

---

<div class="post-metadata">

**Author:** ![spatel\_093](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@spatel\_093](https://forums.toadworld.com/u/spatel_093)\
**Post date:** [September 29, 2011, 2:51pm UTC](https://forums.toadworld.com/t/label-functions/6891/3 "2011-09-29T14:51:34Z")

</div>

Hi Debbie,

Let me explain better…

I created a query which returns “todays\_sales”, “last\_yr\_sales”, “change”, & “percent\_change” for 20 stores we have. I exported the data to report designer and during the wizard steps it asks if you would like to sum any columns. I chose to select all four columns. Click finish \> preview and voila i have all my numbers by store and a grand total at the bottom summing the values in the column. This works great except for the percentage. Instead of taking the sum(Change) and dividing by Sum(Last\_Yr\_Sales) it just adds the % from all rows and gives me the wrong %.

SO…I tried creating a calculated field which had the expression: SUM([Change])/SUM([Last\_Yr\_Sales]) …but that did not work.

Is there any way to use the labels that toad creates in the explorer window to create the correct value, or am i just doing something wrong? I attached an excel file to visualize my problem.

Thank You  
[Example.xls](https://global.discourse-cdn.com/quest/original/2X/8/8a20d4a9287e861d13adb903e1dc8fda46fb084d.xls) (14 KB)

---

<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:** [September 29, 2011, 4:48pm UTC](https://forums.toadworld.com/t/label-functions/6891/4 "2011-09-29T16:48:17Z")

</div>

I see. It seems like you should be able to do this with a calculated column but I couldn’t get it work either. I would move the sum() and SUM([Change])/SUM([Last\_Yr\_Sales]) into your SQL and not do this in the Data Report.

That should be doable, right?

Debbie

---

<div class="post-metadata">

**Author:** ![spatel\_093](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@spatel\_093](https://forums.toadworld.com/u/spatel_093)\
**Post date:** [September 29, 2011, 5:07pm UTC](https://forums.toadworld.com/t/label-functions/6891/5 "2011-09-29T17:07:44Z")

</div>

Thanks for the help. I figured that may be the only way to get this to work. I’ll give it a go and see what happens.

---

<div class="post-metadata">

**Author:** ![eric.chilenskas](https://avatars.discourse-cdn.com/v4/letter/e/4da419/32.png) [@eric.chilenskas](https://forums.toadworld.com/u/eric.chilenskas)\
**Post date:** [January 7, 2014, 12:52pm UTC](https://forums.toadworld.com/t/label-functions/6891/6 "2014-01-07T12:52:30Z")

</div>

Looks like the ability to perform calculations between summary fields within a group footers hasn’t been resolved in 3.4 yet, either?
