cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

min function on timeseries

MartinKulov
Participant

Is there a way to replace values on a timeseries metric using the min aggregation?

So lets say we have example data like (5,15,50,20,9) and we want to apply min(10) and the timeseries will be converted to (5, 10, 10, 10, 9).

 

Kind regards

3 REPLIES 3

You can do this with by using an iterative expression within an if statement.

data record(data = array(5,15,50,20,9))
| fieldsAdd newData = if(data[]<10, 10, else: data[]) // iterate through array elements and replace anything less than 10 with value 10. Else, keep current value.

 

I am sorry, I was referring to Data Explorer and Classical Metric expressions, not DQL.

Any idea how to implement this in Data Explorer?

@MartinKulov Sure there is a solution.
You need to use :partition , apply the :filter and then substitute it using the :default transformation.

See an example in the playground tenant

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts