Reference to the clampMax() and clampMin() functions


clampMax(<max>, <tsExpression>)
clampMin(<min>, <tsExpression>)
  • The clampMax() function changes any point larger than max to max
  • The clampMin() function changes any point smaller than min to min


max For clampMax(), changes all values that are larger than max to max.
min For clampMin(), changes all values that are smaller than min to min.
tsExpression Expression that describes the time series you want to filter.


Allows you to add a specified bound to your data points.

  • clampMax() sets an upper bound. For example, clampMax(5, ts(xx)) changes any data points that are larger than 5 to 5.
  • clampMin() sets a lower bound. For example, clampMin(24, ts(xx)) changes any data points that are smaller than 24 to 24.


In the following example, we look at a simple latency metric for one source (blue line). Then we use clampMax to set all values over 180 to 180 (green line).

clamp max example