Filtered views, a better way?

Hi,

I have a database that has about 100 views. The views are all categorized differently. The main form has 4 levels. 1 being the highest & 4 being the lowest. Each document with this form is called a “policy”. A policy can have many documents associated with it. 1 at level 1, 1 at level 2, 1+ at level 3, 1+ at level 4 all pertaining to the area. Level 1 is Global. Level 2 is Area(I will use “EMEIA” for my example). Level 3 is sub-area(I will use “FraLux”, “UK&I”, & “BeNe” for my example) & level 4 is country.

For my example “France” is in “FraLux”, “Ireland” is in “UK&I”, and “Belgium” is in “BeNe”.

My example: Policy “A” has a document at Global (level 1), at EMEIA (level 2), at FraLux (level 3), at UK&I (level 3), and at France (level 4). (though realistically there could be 80 documents at level 4). Each of these documents has a key field tying them together so we know they are all part of the same policy. Currently all policies at all levels show up in the views. The customer has now asked for a profile driven filter. User A comes into the db (or visits the domino end) and sets a filter by a country. The client then wants all the views to then remember this setting (so a profile doc or env variables/cookies but client & domino don’t have to talk to each other if we use env var/cookies route) and show only the related policies in the views. However if that country policy doesn’t exist then we still show the lowest level of that policy pertaining to the country. So for Policy “A” above if user selects Ireland from dropdown, all views will show only the “UK&I” document for Policy “A” since an Ireland document does not exist. If France was chosen then France would show and if Belgium is chosen then EMEIA policy would show since neither Belgium (level 4) or BeNe (level 3) exists for Policy A. In same view we would see many many policies all showing just the lowest level pertaining to that country. So if I haven’t lost you yet, the only thing I can think of seems like it would slow the opening of these views considerably. I was thinking of running an agent that would stamp a new field on the lowest level of that policy with the country so for Policy A new multi value field on EMEIA containing all countries in EMEIA (which it would get from a lookup view) except for any countries in UK&I & Fralux. UK&I would contain all countries in that field in UK&I, Fralux would contain all countries but France in that field and France would contain France. Then each view would get a new categorized column sorted by this new field. Once a user selects his country & saves the setting we would then do a lookup to this setting & use @setViewFilter in outline entry code to the view for client, and &RestrictToCategory in domino. I think I would need to stamp each document with an “All” as well because I don’t want that first column to ever show up & I need a way for users to see all docs if they do not set a specific country.

On other projects I have always found @setviewfilter kind of flaky, plus as I mentioned up top I am worried about performance. Is there a better way?

Thanks so much!