# How not display lines containing zeros in a Power table (dataset)

**URL:** <https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331>\
**Category:** Ignition\
**Created:** [September 2, 2020, 9:12pm UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331 "2020-09-02T21:12:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icom](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@Icom](https://forum.inductiveautomation.com/u/Icom)\
**Post date:** [September 2, 2020, 9:12pm UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331/1 "2020-09-02T21:12:06Z")

</div>

Hello I have a powertable that is connected to a dataset tag. The table shows all the data in the dataset, however I want the lines where zero appears to not appear. Besides this, I want the cells of a column to change when the value of another column is higher than the maximum limit. Could you give me a hint? Thank you

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [September 3, 2020, 2:15am UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331/2 "2020-09-03T02:15:13Z")

</div>

Some hints:

> [@Filtering results of a dataset](http://forum.inductiveautomation.com/t/filtering-results-of-a-dataset/3807):
>
> Lets say I run this code to populate a table with battery voltages: [code]query = “SELECT displayname, devicename from devices” if event.propertyName in [“devices”, “refresh”]: table = event.source.getComponent(‘Table’) newData = [] header = [“Displayname”, “Identifier”, “Battery Voltage”] res = system.db.runQuery(query) tagPaths = [] for row in res: tagPath = row[1] tagPaths.append("%s/Volts"%tagPath) results = system.tag.getTagValues(tagPaths) idx = 0 for row in res: displayNa…

> [@Named Query, Power table, Row color based off column value](http://forum.inductiveautomation.com/t/named-query-power-table-row-color-based-off-column-value/20779):
>
> This should be fairly easy however I am quite new at this, scoured the forms and much of what I’ve found is quite vague. I have a power table running a named query that updates every 5 min. I would like to change the row colors based on the value in column 8. The values in column 8 go up to 400. From 0-90 I would like the row to be red, from 90-120 the row yellow, from 120-400 green. I have tried various scripts in the configureCell to no avail. Can this be done by binding in the Backgroun…

---

<div class="post-metadata">

**Author:** ![Icom](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@Icom](https://forum.inductiveautomation.com/u/Icom)\
**Post date:** [September 3, 2020, 1:59pm UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331/3 "2020-09-03T13:59:44Z")

</div>

Thanks for you answer but still doesn’t work.  
Here is my script:

```
if colName == 'T2T':
	if (self.data.getValueAt(0,25)) < (self.data.getValueAt(0,26)):
					return {'background': '250,2,191'}

```

the problem is that I can’t change the color of a single cell, the whole column changes color.  
How I change the color of a single cell based on a result. Thanks.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [September 3, 2020, 2:04pm UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331/4 "2020-09-03T14:04:12Z")

</div>

It’s because you’re always comparing the same values: `self.data.getValueAt(0,25)` always gets a value from row 0 and column 25.

You need to use the `rowIndex` argument to get the value of the current row: `self.data.getValueAt(rowIndex, 25)`

---

<div class="post-metadata">

**Author:** ![Icom](https://avatars.discourse-cdn.com/v4/letter/i/e68b1a/32.png) [@Icom](https://forum.inductiveautomation.com/u/Icom)\
**Post date:** [September 3, 2020, 8:28pm UTC](https://forum.inductiveautomation.com/t/how-not-display-lines-containing-zeros-in-a-power-table-dataset/38331/5 "2020-09-03T20:28:17Z")

</div>

Thanks for you answer.
