Simple Notes Formula Question

Can anybody please explain to me what the following view selection formula is doing.

region := @Name ( [OU2]; @Subset ( FullName;1 ) );

office := @If ( region = “RM”;@Middle ( @Name ( [OU3]; @Subset ( FullName;1 ) ); 2; 1);

region = “HO”; @Left ( @Name ( [OU3]; @Subset ( FullName;1 ) ); 1);@Middle ( @Name ( [OU3]; @Subset ( FullName;1 ) ); 1; 1) );

psuser := @Contains ( @Name ( [OU3]; @Subset ( FullName;1 ) ); “PS” );

local := @Contains ( @Name ( [OU4]; @Subset ( FullName;1 ) ); “LOCAL” );

training := @Contains ( LastName; “User” ) | @Contains ( LastName; “USER” ) | @Contains ( LastName; “TEACH” );

SELECT Type = “Person” & office = “P” & ! ( psuser | local | training )

TIA

Ki

Subject: Simple Notes Formula Question

Ki,

Effectively, the selection formula is checking that the FullName doesn’t have organizational units with “PS” or “TEACH”, and the LastName doesn’t have “User” or “USER”.

regards,

raphael

Subject: RE: Simple Notes Formula Question

Thanks for the answer. But what is meant by the following in the last line. He is calculating region and office and using it over here.Any clues??

office = “P” in

SELECT Type = “Person” & office = “P” & ! ( psuser | local | training )

TIA,

Ki

Subject: RE: Simple Notes Formula Question

You are correct when you say that he is calculating office, but he is calculating it based on the [OU3] of the users full heirarchical name; which of course is an unknown quantity.

What he is saying is he only wants to see the documents where the appropriate character in the [OU3] is ‘P’.

HTH

Geoff Poole

Subject: RE: Simple Notes Formula Question

This is quite the selection formula, here is how is breaks down:Set the region variable to be Organization Unit 2 of the full user name.

Set the office variable to be one character of Organization Unit 3 of the FullName, selected based on the region.

Set 3 different true/false variables based on if PS in the FullName, LOCAL is in the FullName, User/USER or TEACH is in the LastName.

Finally the actual view selection is for all documents where the Type field is Person, the office variable is calculated to be P, and any 1 of the 3 true/false variables are true.

The hardest part to figure out without seeing the data is where office is determined to be “P” or not, based on the region and different parts of the FullName. Hope this clears it up for you.