Hello expert,
I’m trying to do a calculation between 2 metrics, but without success.
the following is the expression without a calculation:
core.daemon.user.authentication.count:filter(and(or(eq(step,finish),eq(step,start)))):splitBy(step):sum:sort(value(sum,descending)):limit(20)
I need to calculate step:start- step:finish
Is it possible to dio that?
Thanks,
Luciana
Hi, @Lucybellonikeyl
try this:
core.daemon.user.authentication.count:filter(and(or(eq(step,start)))):splitBy():sum:sort(value(sum,descending)):limit(20) - core.daemon.user.authentication.count:filter(and(or(eq(step,finish)))):splitBy():sum:sort(value(sum,descending)):limit(20)
Hello,
You should be able to do so with a simple subtraction expression. Try something like…
<span>core.daemon.user.authentication.count:filter(and(or(eq(step,start)))):splitBy(step)<br>+<br>core.daemon.user.authentication.count:filter(and(or(eq(step,finish)))):splitBy(step)<br></span>
Here’s a link to the docs.
The problem here is the splitBy(step). Since the dimensions values are different the calculation will not works. You will need to make it splitBy(), empty, or use other dimension that match on both results.