Charitha Amaraneni Posted February 5, 2019 Share Posted February 5, 2019 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 More sharing options...
Sayali Patil Posted February 8, 2019 Share Posted February 8, 2019 Hello, Please take a look at this post for reference on how to get the unique values in a column - https://spotfired.blogspot.com/2014/02/get-unique-values-from-row.html Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now