How to calculate date diff in custom expression?

Hello,

How can I calculated the difference between dates in a custom expression?

I'm trying that:

image

And getting this result:

image

But I need it in seconds or minutes to create a chart

Thank you

Hi @trialsin
There's a request for having a function in Custom Expressions:
https://github.com/metabase/metabase/issues/16870 - upvote by clicking :+1: on the first post

1 Like

That would be very helpful.

Did you find any workaround?

Hi Tanguy,

I think you can do this with a native query, but it depends on what type of source database is.

Indeed :man_facepalming: