Complex calculations as fields

Suppose I have a database that has Orders, which each have many Changes, which each have many Items.

I’d like to find the total price of all Items in the most recent Change for each Order. This “total price” calculation requires some non-trivial logic based on some fields on the Items and some fields on the Change.

Is is possible to do this with Metabase? Ideally it could saved as some sort of custom field for Orders.

Hi @tcourtqtm
I think currently, you would have to do the query in SQL. Perhaps you could get far with the Notebook editor, but I don’t have access to your dataset, so it’s much easier for you to play around with that.