Performance Measurement: Returns

Part II: Measuring Returns This blog is about how to process investment performance using SQL and a database. In the first part , we set up a test database with seven tables, and populated the tables with some test data. In this second part, I will build some views in the database to calculate portfolio returns with daily time series of market values and cash flows. These returns will be presented in both absolute (currency) and relative (percentage) terms, and on all portfolio structure levels for all structures defined. But first, I'll set up an indexed view on portfolio structures. All the code for the three views can be found in my GitHub repository . As the SQL statements are at times quite long, they are not necessarily copied here in full, so I recommend GitHub for those interested. Indexed View Sometimes Helps The way I have set up the Structure table is the following: select * from PerfTest. Structure The table is simple; each structure has a ShortName , a LongName...