Jump to content
  • Reset the date filter to last 3 months whenever the dashboard is opened using IronPython


    This script can be triggered by updating the current datetime into a document property using a simple R script. IronPython script then is attached to this document property to trigger it every time the dashboard opens.

    from Spotfire.Dxp.Application.Filters import RangeFilter,ValueRange
    from Spotfire.Dxp.Data.DataType import Date
    from System import DateTime
    from System.Globalization import CultureInfo
    myPanel = Document.ActivePageReference.FilterPanel
    # tablegroups is referring to table number 5 and it's date column
    myFilter = myPanel.TableGroups[5].GetFilter("Date_column")
    #print myFilter
    lblFilter = myFilter.FilterReference.As[RangeFilter]()
    strMaxDate = lblFilter.ToString().split('=')[2][:-2]
    max = Date.Formatter.Parse(strMaxDate)
    min = max.AddDays(-91)
    #print min



    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...