How to use the .max() in timelion

Hi All,
I use this expression:

Exp1
.es(_exists_:candles.highMid, timefield=candles.time,offset=-1d).if(eq, 0, null, .es(timefield=candles.time,offset=-1d,metric=sum:candles.highMid)).fit(average)

and this expression:

Exp2
.es(_exists_:candles.highMid, timefield=candles.time).if(eq, 0, null, .es(timefield=candles.time,metric=sum:candles.highMid)).fit(average)

But! I would like to plot the highest of these - max(Exp1, Exp2). Is this possible?

Br
Cris

Hi there Cris, you can combine and compare your expressions using the max function like this:

.es(_exists_:candles.highMid, timefield=candles.time,offset=-1d).if(eq, 0, null, .es(timefield=candles.time,offset=-1d,metric=sum:candles.highMid)).fit(average).max(
  .es(_exists_:candles.highMid, timefield=candles.time).if(eq, 0, null, .es(timefield=candles.time,metric=sum:candles.highMid)).fit(average)
)

Hope this helps!

CJ

Thanks! Works fine!.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.