How to give document property value into Table.Select()

This question is based on https://community.tibco.com/questions/fetching-specific-cell-datatable-u...

For example: in the table below i want to find sales corresponding to period 2017-2 (i.e. 300)

 

Period Sales
2017-1 400
2017-2 300
2017-3 500

I am able to get it using the answer :

from Spotfire.Dxp.Data import *
from System.Collections.Generic import List

table=Document.ActiveDataTableReference
# select an expression to limit the data in a table 
rowSelection=table.Select('Period = "2017-2"')

# Create a cursor to the Column we wish to get the values from
cursor = DataValueCursor.CreateFormatted(table.Columns["Sales"])

# Create List object that will hold values
listofValues=List[str]()

# Loop through all rows, retrieve value for specific column,
# and add value into list
for  row in  table.GetRows(rowSelection.AsIndexSet(),cursor):
   rowIndex = row.Index
   value1 = cursor.CurrentValue
   listofValues.Add(value1)


for val in listofValues:
	print val

but in line 6, can anyone tell me how to specify an value of document property instead of "2017-2" ? 

(1) Answer

Login