How to set Marking for In-Database (External ) using Iron Python Script

Hi Team,

 

I want to set marking for In-Database (External ) Datatable. I use the below script.I get no error.But RowCount is priniting as 0.Kindly help me in fixing this.

 

from Spotfire.Dxp.Data import IndexSet, DataValueCursor, RowSelection
rowCount = Document.Data.Tables["VW_WellTestHistory_Duplicate"].RowCount
print rowCount
rowsToInclude = IndexSet(rowCount,True)
cursor = DataValueCursor.CreateFormatted(Document.Data.Tables["VW_WellTestHistory_Duplicate"].Columns["PK_View"])
rowsToFilter = IndexSet(rowCount,False)
for row in Document.Data.Tables["VW_WellTestHistory_Duplicate"].GetRows(rowsToInclude,cursor):
  rowIndex = row.Index
  value1 = cursor.CurrentValue
  print value1
  if value1 == "1":
    rowsToFilter.AddIndex(rowIndex)
Document.Data.Markings["Marking"].SetSelection(RowSelection(rowsToFilter), Document.Data.Tables["VW_WellTestHistory_Duplicate"])

 

 

Login