Jump to content
  • How to read Column Values in Spotfire® Using IronPython Scripting


    How to read Column Values from a given Data Table using DataValueCursor

    Introduction

    How to read Column Values from a given Data Table using DataValueCursor

    Code sample

     # Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    
    tableName='World Bank Data'
    columnToFetch='Region'
    activeTable=Document.Data.Tables[tableName]
    rowCount = activeTable.RowCount
    print rowCount
    rowsToInclude = IndexSet(rowCount,True)
    cursor1 = DataValueCursor.CreateFormatted(activeTable.Columns[columnToFetch])
    ctr1 = 0
    for row in activeTable.GetRows(rowsToInclude,cursor1):
    	rowIndex = row.Index
    	val1 = cursor1.CurrentValue
    	print val1
    	ctr1 = ctr1 + 1
    	if (ctr1 == 5):
    		break
     

     

    References

    License:  TIBCO BSD-Style License


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...