06 Aug 2024 07:22 AM - last edited on 20 Aug 2024 01:06 PM by MaciejNeumann
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
Solved! Go to Solution.
08 Aug 2024 06:09 PM
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)
08 Aug 2024 07:30 PM
Hello,
You should be able to do so with a simple subtraction expression. Try something like...
core.daemon.user.authentication.count:filter(and(or(eq(step,start)))):splitBy(step)
+
core.daemon.user.authentication.count:filter(and(or(eq(step,finish)))):splitBy(step)
Here's a link to the docs.
08 Aug 2024 07:47 PM - edited 08 Aug 2024 07:59 PM
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.