#get list of filtered rows
dt = Document.ActiveDataTableReference
rows = Document.ActiveFilteringSelectionReference.GetSelection(dt).AsIndexSet()
#get min and max numeric values from the set
min = dt.Columns["Date"].RowValues.GetMinNumericValue(rows.First)
max = dt.Columns["Date"].RowValues.GetMinNumericValue(rows.Last)
#or you could get the min and max formatted values from the set
min = dt.Columns["Date"].RowValues.GetFormattedValue(rows.First)max = dt.Columns["Date"].RowValues.GetFormattedValue(rows.Last)
#or you could get the min and max values from the entire dataset
min = dt.Columns["Time"].RowValues.GetMaxValue()
max = dt.Columns["Time"].RowValues.GetMinValue()
2 comments:
Is it possible to reference the min and max variables in this example in the expressions used in a visualization?
you will need to store min and max values into a (Date) document property like this: Document.Property["myMinDateDocProp"] = min
To use it in a custom expression, do something like DateDiff('day',[myDateCol], ${myMinDateDocProp})
Post a Comment