Usage of fields in datetimeAdd expression


I'm using datetimeAdd expression to calculate an ending warranty date, based on :

  • a warranty subscription date
  • a amount of month of subscription

The documentation seems to tell that the "amount" field can't be a queried field.

I use datetimeAdd([MyTable → Warranty Date], 12, "month") which works.

But in fact, the amount should be queried from [MyTable → Warranty Duration] which seems not to work.

Any idea ?

My Metabase version : 0.47.0.

Thanks !

1 Like

Do you mean to state that the desired expression would be

datetimeAdd([MyTable → Warranty Date], [MyTable → Warranty Duration], "month")

That is similar to my problem, where I'm trying to calculate

datetimeSubtract(now, day(now), "day")

Looks like the add or Substract amount cannot be a calculation...