Jump to content

Get unique count of Value axis from the Marked Data


Charitha Amaraneni

Recommended Posts

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()))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...