rahul S Posted February 2, 2017 Share Posted February 2, 2017 from Spotfire.Dxp.Application.Filters import ListBoxFilter filt=Document.FilteringSchemes[0][myDataTable][myDataTable.Columns["as400_district_name"]].As[ListBoxFilter]() for c in filt.SelectedValues: print c This gives me selected values in addition to that I need to print the all values when All is selected in the filter and assign them to a document property. Thanks. Link to comment Share on other sites More sharing options...
Sean Riley Posted February 3, 2017 Share Posted February 3, 2017 So you need to look at the value of IncludeAllValues which will either be True or False. If False, then you can use SelectedValues to get the explicitly selected. If it is True then you need to get all the values (perhaps it can be done through the filter, but i just went straight to the data table here): from Spotfire.Dxp.Application.Filters import ListBoxFilter from Spotfire.Dxp.Data import * filt=Document.FilteringSchemes[0][myDataTable][myDataTable.Columns["myColumn"]].As[ListBoxFilter]() # This gets you any explicitly selected values if not filt.IncludeAllValues: for c in filt.SelectedValues: print c # If (All) is selected then loop through table to get all values else: allUniqueValues = '' cursor1 = DataValueCursor.CreateFormatted(myDataTable.Columns["myColumn"]) for row in myDataTable.GetRows(cursor1): if allUniqueValues == '': allUniqueValues = str(cursor1.CurrentValue) elif allUniqueValues.find(cursor1.CurrentValue) == -1: #if it is not found in the list already, so only unique values are recorded allUniqueValues += ',' + str(cursor1.CurrentValue) print allUniqueValuesYou will need to clean up your outputs, but this gives you the general idea. API Reference: https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-a... Link to comment Share on other sites More sharing options...
Laxmi Acharya Posted January 22, 2019 Share Posted January 22, 2019 How would you get the values through filters in case you dont want to iterate through all the values of column 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