Newbies abp Posted September 20, 2002 Newbies Posted September 20, 2002 I need an elegant solution for appending sequential serial numbers to parent file ids in a child file. Scenario: I am trying to calculate investment performance for multiple investment portfolios. I have two files: a portfolios.fp5 (parent) and a performance.fp5 (child). The performance file keeps monthly performance data and has cumultive performance calculations, requiring me to use a self-join so that I can use data from previous records (ie., 1 month back, 6 months back, 120 months back, etc.). This is no problem really. The problem arises when I attempt try to track more than one portfolio in the file. I can track the performance of one portfolio in one file and calculate cumulative and average annual performance by geometrically linking previous records' monthly performance. I go back 120+ records; however, sequential serial numbers are critical to the problem. Alternatively, since the performance records all have month end dates (report_date), I could also link records by using Date(Month(report_date), 1, Year(report_date) ) -1. Either way, the problem occurs when I reference another portfolio in the performance file, then my sequential numbering gets screwed up. I suppose I'd like my performance file to serializes itself using the portfolio_id from a separate portfolio file. For instance: Portfolio_ID & NumToText(Serial) But it must be in sequential order so that the performance calculations work. Again, a solution with a date might help too. Please, someone, help. Thanks.
kennedy Posted September 20, 2002 Posted September 20, 2002 Not sure I followed all that, but my quick guess is this: When you move from one portfolio to many, your self-join on that file needs to include the portfolio ID as part of the match in the self-join... you only want to join with the relevant (same portfolio) records. Well, maybe that tidbit will be helpful.
Recommended Posts
This topic is 8170 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now