bbaliner Posted April 4, 2002 Posted April 4, 2002 Hi guys, I am wandering if it's possible to view the "many side" of the relationship in the portal without normalizing the file into two files. What I mean is: I have a file called companies, which also has employees in it. I know this is not the right way to do things, but let's just say that's the situation. There are several employees in each company. Is there a trick with selfjoin to view all the employees per each company in a portal? Thank you
goldraven Posted April 4, 2002 Posted April 4, 2002 It depends on what your data structure looks like. Do you have a seperate record for each employee? If so, then you can do a selfjoin on the company ID or company field.
bbaliner Posted April 4, 2002 Author Posted April 4, 2002 Goldraven, Yes, there is a separate record for each employee. Usually, I would normalize this into two separate files (Company and Employee), but in this case I can't. When I selfjoin on the CompanyID, only one employee (the one in this record) shows up, e.g. If I specify the portal to be 10 records long, employee "01" will show up 10 times. CommentTest2.zip
goldraven Posted April 4, 2002 Posted April 4, 2002 Even though you've said you can't, I have to say that the best way to do this is to normalize That said, to do this properly, you need unique numerical IDs (preferably) or names for each company and each employee. Anytime you have a record for a specific company, it would have to have the correct ID. Since you want to see multiple employees for single companies, the way you have the file set up now would require you to do the selfjoin on the company ID. That way the portal will find all the records in the DB where the company is the same as the record you are currently looking at. Then, within that portal, show the employee.. and this is important.. make sure you show the Employee field _from the selfjoin_ relationship, not from the "current file".
bbaliner Posted April 4, 2002 Author Posted April 4, 2002 raven, I did exactly that last time, and was wandering why it's not working for me (I did that before with selfjoins). Now I deleted my portal, and created a new identical one (without editing the relationship) and it worked this time. Wierd...I think you scared my FM into submission. Thanks
Recommended Posts
This topic is 8270 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