from Spotfire.Dxp.Application.Visuals import VisualContent
from Spotfire.Dxp.Data import IndexSet
from Spotfire.Dxp.Data import RowSelection
from Spotfire.Dxp.Data import DataValueCursor
#Script parameters:
selectedTag ='Walmart'
ColumnName = 'Store'
#get table reference
vc = vis.As[VisualContent]()
dataTable = vc.Data.DataTableReference
#set marking
marking=vc.Data.MarkingReference
#setup rows to select from rows to include
rowCount=dataTable.RowCount
rowsToInclude = IndexSet(rowCount, True)
rowsToSelect = IndexSet(rowCount, False)
#Find records by looping through all rows
idx=0
for row in dataTable.GetRows(rowsToInclude, cursor1):
found=False
aTag = cursor1.CurrentValue
if aTag==selectedTag:
rowsToSelect[idx]=True
print idx
idx=idx+1
#Set marking
marking.SetSelection(RowSelection(rowsToSelect), dataTable)
No comments:
Post a Comment