Hi All, I have the following fairly simple datasource that I would like to calculate the `Total Amount` (BigNumber).\nAs you can see though there are duplicate rows since for an `order_id` there could be multiple `user_id`.\nThats a fairly simple query to de-duplicate and then calculate the `Total Amount`.\nIn my case though I would like to be able to filter by `user_id` as well i.e When `user_id = 1` the `Total Amount = 161`.\nIn order to be able to do this though I must filter the datasource before any aggregate (SUM) function.\n\nDid you had a similar requirement and how did you solve it ?\nI think `Jinja` is the only solution but I would love to hear if there is an alternative.\n\nMy db engine is PostgreSQL if that helps.