Filtering results of a dataset

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:
displayName = row[0]
tagPath = row[1]
newData.append([displayName, tagPath, results[0+idx]])
idx += 1

table.data = system.dataset.toDataSet(header, newData)[/code]

Is there a way for me to add a filter to show only results that are <12?

How about this:

[code]
idx = 0
for row in res:
displayName = row[0]
tagPath = row[1]
if results[0+idx]<12:
newData.append([displayName, tagPath, results[0+idx]])
idx += 1

table.data = system.dataset.toDataSet(header, newData)[/code]

well that was easy! thanks.