AlanP Posted January 8, 2007 Posted January 8, 2007 I'm unsure of how to make this work. I was using the operator of "" to make the specified field (such as "RECORDS DEPARTMENT" match exactly, however I decided to go to 'global' fields so we don't have to change the code manually (thus the code below where "Configuration:LVMPGRP00_1" is a global field). Now, because I can't use "" with the global fields, I can't make it do an 'exact' match on the contents of that global field and it looks for *anything* in that global (so if I only wanted it to hit on "RECORDS DEPARTMENT" it won't work with the global because any other entry that has "RECORDS" or "DEPARTMENT" will hit. Wow, hope that made sense! Just trying to find out how to make it match exactly using global fields in a calculation. Case ( PatternCount ( Bureau of Assignment History ; Configuration::LVMGRP09_1 ) or PatternCount ( Bureau of Assignment History ; Configuration::LVMGRP09_2 ) or PatternCount ( Bureau of Assignment History ; Configuration::LVMGRP09_3 ) or PatternCount ( Section Assignment History ; "Configuration::LVMGRP09_4" ) or PatternCount ( Section Assignment History ; Configuration::LVMGRP09_5 ) or PatternCount ( Section Assignment History ; Configuration::LVMGRP09_6 ) ; "SECURITY GROUP 1 & 9" )
comment Posted January 9, 2007 Posted January 9, 2007 Makes no sense to me, sorry. Why don't you describe what you WANT to do, instead of what you did (and it didn't work)? In general, Fieldname (unquoted) returns the field's contents, while "Fieldname" returns the text string "Fieldname". To test for an exact match use either the = operator or the Exact() function (read the help on the difference between these two).
AlanP Posted January 9, 2007 Author Posted January 9, 2007 I want it to match exactly what is in the global fields, but can't use "" because then it will only look for the field name and not it's contents. For example here is how it used to look: Case ( PatternCount ( Bureau of Assignment History ; "RECORDS BUREAU" ) or PatternCount ( Bureau of Assignment History ; "RECORDS IMAGING BUREAU" ) ; "SECURITY GROUP 1 & 9" ) but using the global fields instead of straight text, the calculation can't lock down to look 'exactly' for what the field has in it because I can't use quotation marks: Case ( PatternCount ( Bureau of Assignment History ; Configuration::LVMGRP09_1 ) or PatternCount ( Bureau of Assignment History ; Configuration::LVMGRP09_2 ) ; "SECURITY GROUP 1 & 9" ) Hope that made sense! I hope there is an easy solution, I just can't find it anywhere!
comment Posted January 9, 2007 Posted January 9, 2007 (edited) I still don't know what you want to do. ADD: 1. If you want to compare the contents of two fields, don't use quotes. Use either: Exact ( Somefield ; Anotherfield ) or: Somefield = Anotherfield 2. It works the same with global/regular fields. 3. If you want exact match, don't use PatternCount(). Edited January 9, 2007 by Guest Didn't finish what I wanted to say.
Søren Dyhr Posted January 9, 2007 Posted January 9, 2007 (edited) of that global field and it looks for *anything* in that global (so if I only wanted it to hit on "RECORDS DEPARTMENT" it won't work with the global because any other entry that has "RECORDS" or "DEPARTMENT" will hit. No not true, it uses the entire string as match criteria: http://www.filemaker.com/help/FunctionsRef-369.html But I'm with Comment here, it's almost needless to get a method statement, if a wrong stragegy has been chosen ...is it a gamble with long odds to expect any of us have been cought in exact the same pithole. Instead do we need a mission statement! --sd Edited January 9, 2007 by Guest
AlanP Posted January 9, 2007 Author Posted January 9, 2007 OK...if PatternCount is not the right way to go, what would be the better choice? PatternCount worked *perfectly* when I specified the departments in the calculation (such as "RECORDS DEPARTMENT"). Now that I'm using global fields where the actual text would have been and that's where I'm running into a problem because I can't put the quotation marks around the field name, so (at least in the database) it looks for any other record entry with similar words (RECORDS or DEPARTMENT) instead of (RECORDS DEPARTMENT).
Søren Dyhr Posted January 9, 2007 Posted January 9, 2007 We're still awaiting a mission statement, PatternCount might fit in but we can't really tell, when you're keeping us in suspence. One option is to define the search values, as CF's it will allow continuing indexation of the field, which can be the real problem you expirences. --sd
AlanP Posted January 9, 2007 Author Posted January 9, 2007 We're still awaiting a mission statement, PatternCount might fit in but we can't really tell, when you're keeping us in suspence. One option is to define the search values, as CF's it will allow continuing indexation of the field, which can be the real problem you expirences. --sd Well this is one of 10 similar calculations. It is used to show the user if an employee needs a special security group for access based on where they work. So each security group is broken up into it's own similar calculation. If it shows RECORDS BUREAU (for example) it will come back with SECURITY GROUP 1 (or something like that). However if their department is INFORMATION TECH it will come back as SECURITY GROUP 2 based on another calculation.
Søren Dyhr Posted January 9, 2007 Posted January 9, 2007 (edited) It's not getting me much nearer, but I have spotted something I can't see why - the 4th line of your original Case( statement is the apparent field reference suspended: PatternCount ( Section Assignment History ; "Configuration::LVMGRP09_4" ) Then do you write this: I can't make it do an 'exact' match on the contents of that global field Why not? - Is this what you really wish to do, get a match of some of the values stored in the global, but not nesserarily all and in the given sequence??? The issue is that I got what I expected when trying your calc's from the second post. You see what you expect doesn't apparently follow the definition of the function and you need something else. How is data entered? - Into the fields: Bureau_of_Assignment_History Section_Assignment_History Now this is a relational database system, and several facts from one field isn't exactly an optimization goal, frankly is it the opposite! --sd Edited January 9, 2007 by Guest
comment Posted January 9, 2007 Posted January 9, 2007 I am still not sure I understand this correctly, but if I do: I would have (at least) 2 tables: Employees and Departments, related on DepartmentID. Each department would be assigned a security level (either from a custom value list or from a third table). This way, when an employee is assigned to a department, the required security level is given by the field in the related department record - no calculations required (and no changes in formulas when security levels are changed, departments added/renamed, etc.).
Recommended Posts
This topic is 6589 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