Good morning,
I am trying to write a query returning the Dates and Value of a Portfolio at that dates.
The Portfolio is based on Transactions and Prices.
I have got the following tables:
Dates (Dates)
Transactions (Dates, Product, Quantity)
Prices (Dates, Product, Price)
For clarity, the value of my portfolio on Date D is then defined as:
Sum of (Sum of (Quantity Where Date < Date D)) *( Price Where Date = Date D))
I manage to get the value of the Portolio on a specified Date running a query with a parameter, but not the history of those Values on all the Dates.
I have tried to find a solution to this (rather basic) issue on the web, and could not find it.
Many thanks in advance