Book Image

TIBCO Spotfire: A Comprehensive Primer

By : Michael Phillips
Book Image

TIBCO Spotfire: A Comprehensive Primer

By: Michael Phillips

Overview of this book

Table of Contents (18 chapters)
TIBCO Spotfire – A Comprehensive Primer
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Manipulating data already loaded into Spotfire


There are many ways to manipulate the data in an analysis file using the Spotfire.Dxp.Data namespace, but the three most common activities are navigating a table to look up values, marking/selecting data, and creating and changing calculated columns. These are the three areas we're going to cover in this section.

Reading a table

The ability to read a data table using a script is a very useful tool, allowing you, for example, to drive actions based on the values in a metadata table. It's also very easy to do. You just need to define cursors for the columns you want to read and then iterate through the table's rows, inspecting the values of these cursors as you go. The data table object is the key to this activity; so, just to recap, you get a data table object as follows:

dataTable = Document.Data.Tables.TryGetValue(Name of data table)[1]

Action

Property or Method

Define a string cursor

DataValueCursor.CreateFormatted(dataTable.Columns[Column...