I am calculating the performance of client portfolio accounts.
I have a query that compares Day1 Port Value to Day0 portfolio value and calculates the percentage gain or loss. This was accomplished with a self-join and and ID field that counts up. For example Day1 = $11 and Day0 = $10 then the gain is 10%. This continues for each day (Day2 vs. Day1 etc.) the account exists so that I end up with a column of daily percent gains or losses.
Now I would like to create a client performance index that begins at $100 and tracks the account's performance for the specified time period. The problem that I am running into is that the percentages must be compounded, not simply summed, and the next value does not exist yet as it did with my portfolio values so I can't get the self-join trick to work.
It should be $100 * (1 + 10%) = $110
and then 110 * (1 + X%) +$$$$
I would really like to do this in a query, not a report.
If anyone could point me in the right direction I would be grateful.
I have a query that compares Day1 Port Value to Day0 portfolio value and calculates the percentage gain or loss. This was accomplished with a self-join and and ID field that counts up. For example Day1 = $11 and Day0 = $10 then the gain is 10%. This continues for each day (Day2 vs. Day1 etc.) the account exists so that I end up with a column of daily percent gains or losses.
Now I would like to create a client performance index that begins at $100 and tracks the account's performance for the specified time period. The problem that I am running into is that the percentages must be compounded, not simply summed, and the next value does not exist yet as it did with my portfolio values so I can't get the self-join trick to work.
It should be $100 * (1 + 10%) = $110
and then 110 * (1 + X%) +$$$$
I would really like to do this in a query, not a report.
If anyone could point me in the right direction I would be grateful.