1 of 1 people found this helpful
The traditional ("old school") way to do something like this would be to create a calculation field with a result of "Senate District". Then, as you suspected, create a new table occurrence (TO) that joins to your parent table, not only on DistrictID, but also on "Senate District" = DistrictType. (It's called a "multi-predicate join".)
However, if all you want to do is display the records that meet those criteria - you don't have any calculations or other manipulations to do that rely on having that relationship - then you might be better served to use a filtered portal. This is a portal that displays only some of the records from the given relationship. You can do this in the Portal Setup dialog by clicking "Filter portal records":
You'll get the standard calculation dialog box, where you can specify that you only want to see records where, for example, DistrictType = "Senate District".
I tried setting the filter on the portal, but when I did that it returned no related records at all inside the portal, so I thought that was wrong. I have also been trying to create a calculated field for the senate district, but can't make it work. Do you set it up with an if function, or some other way?
Thanks very much!
On the calculated field... I was trying to set up a field that holds the DistrictIDs for the senate districts. I re-read your post. Are you saying to set up a calc field that simply has the text value "Senate District"? I think I could just about manage that, and maybe it will work...
Mike, I tried your "old school" method but couldn't get it to work either. I created a calculated field that holds the value "Senate District" in the DemocratsinRoles table, and also added a Districtid field to that table. Then I made a second occurrence of the Districts table and connected it to DemocratsinRoles. When I add DistrictID from this occurrence to the DemocratsinRoles portal, that field is null. Am I trying to relate the wrong tables to each other?
A filtered portal cannot work here, because you want to match a Senate District to each row of the existing portal.
Try defining a calculation field cSenateDistrict in the Districts table =
Case ( DistrictType = "Senate" ; DistrictName )
and another calculation field in the Democrats table =
List ( Districts::cSenateDistrict )
If I understood your description correctly (and that's a big IF) this field should return (at most) a single name. Place this field in your existing portal.
Your suggestion worked!!! Thank you so very much, you've made my day!
Sorry for not getting back to you sooner; I've been away from my computer.
Thanks for covering it, Michael.
No problem, thanks for your help!