gurusai sankar Posted March 26, 2019 Share Posted March 26, 2019 Hi All, I am beginner for scripting. I have a column called "BASELINE_NAME " and fixed drop down filter in text area. my requirement is- Based on Baseline drop down- capital cost and expenditure cost per year which i am showing in the bar chart should change dynamically and also should reflect all other filters in text area which is related to this data. BASELINE is having the data like 2018B1, 2018B2,2019B1,2019B2. and also i have used filtering schema called "page 2". I have written below script. but it is not working sometimes. Can someone please help on this, Please let me know if script is not required for this requirement. Spotfire.Dxp.Application.Filters import * from Spotfire.Dxp.Application.Visuals import VisualContent from System import Guid #Get the active page and filterPanel page = Application.Document.ActivePageReference filterPanel = page.FilterPanel #Get reference for FilteringScheme used for your filter for fs in Document.FilteringSchemes: print fs.FilteringSelectionReference.Name if fs.FilteringSelectionReference.Name == "page 2": filterPanel.FilteringSchemeReference = fs #Let's find "Col_LBFilter" filter and read the selected Values #This example uses a listbox filter, you may use any. filterPanel.InteractiveSearchPattern = "BASELINE_NAME" for filter in filterPanel.FiltersMatchingSearchPattern: if filter.FilterReference.Name == "BASELINE_NAME": lbFilter = filter.FilterReference.As[ListBoxFilter]() array=Document.Properties["baselinedropdown1"] #lbFilter.IncludeAllValues=False #This will print selected values in List box filter #print lbFilter.SelectedValues #To set list box filter, Make sure that the data type of the values match the column type. In this example, "1,", "2", "5" are the actual column values to be selected in the filter. try: lbFilter.SetSelection(array) except: print "cook" ##_array = ["2018B2"] print "ok" Regards, Guru Link to comment Share on other sites More sharing options...
Richard Pobi Posted March 26, 2019 Share Posted March 26, 2019 I think you do not need scriptfor this. Ensure that youare using the same filtering scheme "page 2"for TextArea and Visualization. When you saved the BASELINE in textarea via Insert Filter it should be good. Link to comment Share on other sites More sharing options...
gurusai sankar Posted March 27, 2019 Author Share Posted March 27, 2019 Thanks for your prompt action. But when i am using the filter- That related filters also shiuld reflect in the text area. if i am using dropdown filter in text area- that related filters are not reflecting. Link to comment Share on other sites More sharing options...
Richard Pobi Posted March 27, 2019 Share Posted March 27, 2019 Hmmm. Is the dataset that you are using for the report comimg from two tables. In other words, did you add column/s to the main table from anothe table If yes, then you need to check how you matched the columns from the two tables. It seems the issue has to do with Joins or Matching of the columns. 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