In the script below I am trimming a dataset to exclude rows where the “Approved_Workcenters” column does not match the local variable “wc”. The change I need to make is to keep rows from the dataset that match “wc” even as a partial match. For example, if wc = “G5-04E” and a row in the dataset has “G5-04E, G5-04W” in the “Approved_Workcenter” column, keep this row. Any suggestions?
rack1 = system.tag.read("[default]KanbanRackCalls/WeldRacksActual").value
wc = system.tag.read("[.]../Workcenter").value
rack2 = system.dataset.toPyDataSet(rack1)
y = len(rack2)
x=0
delete = []
while x < y:
if rack2[x]['Approved_Workcenters'] != wc:
delete = delete + [x]
x=x+1
rack3 = system.dataset.deleteRows(rack1, delete)
system.tag.write("[.]KanbanDisplay", rack3)