Get unique count of Value axis from the Marked Data

Hi,

Im trying to retrieve the marked data into a list and find the max and min values among the marked data. But, my Category axes has a Hierarchy. Also, i want to consider uniqueCount(ValueAxis). Using the code below im not able to get the unique count of records of Value Axis. I only need the unique count of records.

How do i do it? Your help is much appreciated. Sample code below:

from Spotfire.Dxp.Data import DataValueCursor

dataTable=Document.Data.Tables['DataTable']
intCursor = DataValueCursor.CreateFormatted(dataTable.Columns["Column"])

markings = Document.ActiveMarkingSelectionReference.GetSelection(dataTable)

myPanel = Document.ActivePageReference.FilterPanel
keys=dict()

for row in dataTable.GetRows(markings.AsIndexSet(),intCursor):
if intCursor.CurrentValue in keys:
keys[intCursor.CurrentValue]+=1
else:
keys[intCursor.CurrentValue]=1

Document.Properties["maxValue"] = str(max(keys.values()))
Document.Properties["minValue"] = str(min(keys.values()))

(1) Answer

Login