Forum Discussion

Tim Curwick's avatar
Tim Curwick
Copper Contributor
Sep 21, 2017

Complex expression with ago( )

I am trying to work with more complex expressions, and scalar function ago() is not behaving as expected. Specifially, this fails,

print ago( 3 * 5min )

throwing sytax error "ago(): argument #1 must be timespan literal"

This works: 

print ago( 15min )

And this works: 

let x = 15min;
print ago( x )

But this fails: 

let x = 3 * 5min;
print ago( x )

Other functions I have tested don't have the same problem. This works: 

print abs( 3 * 5min )

Is there something I should be or could be doing differently to get the desired result?

  • This has been fixed now...You should be able to use the expressions with ago() and now()
  • This has been fixed now...You should be able to use the expressions with ago() and now()
    • Tim Curwick's avatar
      Tim Curwick
      Copper Contributor

      Ketan,

       

      Cool! Thanks for fixing it. Was this fix already in the pipeline or was that a quick response to the issue being raised here?

  • There was a limitation on ago() and now() with expression. We are working to remove those limitations. Please stay tuned. For now as a workaround you can use something like this: let a=3m; let b=2*a; print now()-b

Resources