Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Set Date RangeFilters porgramatically


from Spotfire.Dxp.Application.Filters import RangeFilter, ValueRange
from Spotfire.Dxp.Data.DataType import  Date

#get a reference to a filter as checkbox from the myDataTable script parameter
filt=Document.FilteringSchemes[0].Item[myDataTable].Item[myDataTable.Columns.Item["Filter Date"]].As[RangeFilter]()

#reset Filter
filt.Reset()

#set min/max filter dates (same as filt.Reset())
filt.ValueRange = ValueRange(filt.ValueRange.Low,filt.ValueRange.High)

#set filter with custom dates
dt1 = Date.Formatter.Parse("1/15/2014")
dt2 = Date.Formatter.Parse("7/16/2014")
filt.ValueRange = ValueRange(dt1,dt2)

1 comment:

Unknown said...

This is awesome. it really made my day !!