# Table color count?

**URL:** <https://forum.inductiveautomation.com/t/table-color-count/71791>\
**Category:** Ignition\
**Created:** [March 29, 2023, 6:21pm UTC](https://forum.inductiveautomation.com/t/table-color-count/71791 "2023-03-29T18:21:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Micky\_Vue](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Micky\_Vue](https://forum.inductiveautomation.com/u/Micky_Vue)\
**Post date:** [March 29, 2023, 6:21pm UTC](https://forum.inductiveautomation.com/t/table-color-count/71791/1 "2023-03-29T18:21:31Z")

</div>

Hi everyone,  
I was wondering if it's possible to do a sum count of a certain color on a table?  
For example:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cba39ad14037c823cfb38760093fb8e412d123b1.png)  
Is it possible to count the total number of cells in a column that is green?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 29, 2023, 6:31pm UTC](https://forum.inductiveautomation.com/t/table-color-count/71791/2 "2023-03-29T18:31:45Z")

</div>

You don't, generally. You perform such counts or similar logic when the data arrives, and you use the same criteria for counting as you do for coloring. How is the coloring currently applied? (A transform that loops through the data?)

---

<div class="post-metadata">

**Author:** ![Micky\_Vue](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Micky\_Vue](https://forum.inductiveautomation.com/u/Micky_Vue)\
**Post date:** [March 29, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/table-color-count/71791/3 "2023-03-29T19:06:00Z")

</div>

The coloring highlights a certain color when the data is within a certain range. In this case, anything greater than 30 will highlight green and anything less then 30 will highlight red. The coding I followed with coloring the table came from here: [Cell Color in Perspective Table - #7 by pkhoshroo](https://forum.inductiveautomation.com/t/cell-color-in-perspective-table/50966/7)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 29, 2023, 7:18pm UTC](https://forum.inductiveautomation.com/t/table-color-count/71791/4 "2023-03-29T19:18:54Z")

</div>

That code loops through the data and determines the color to apply. Initialize a counter to zero before that loop, increment it when you select the color of interest within the loop, and write the result to a custom property somewhere after the loop. That custom property would then be bound to a label or otherwise used elsewhere in your UI.
