Slobey Posted October 27, 2005 Posted October 27, 2005 Hi everyone, I have a field that is set by a calculation. It depends on another field. Currently the field looks like the following: case( recipes::serv_Unit = "Ounce" or recipes::serv_Unit = "Pound"; "Weight"; recipes::serv_Unit = "Cup" or recipes::serv_Unit = "Gallon"; "Volume") the problem I have is that I have many more measurements in each category. I thought there was a way to enter the recipes::serv_unit = part once and nest the possible entries. How can I do this or did I just dream it? Thanks in advance
RodOfNOD Posted October 27, 2005 Posted October 27, 2005 If I understand what you are asking then just create u have defined just a relational db issue. Just create another db that contains the following where Compare and Return are field names: Compare Return Ounce Weight Pound Weight Cup Volume Gallon Volume And then Have a relationshop between your field and Compare and then of course have it show the field Return next to your comparison field.
Slobey Posted October 27, 2005 Author Posted October 27, 2005 (edited) Let me try to explain better. What I want is a field that says case(serv_Unit = "ounce", "pound", "kilogram"; "Weight"; serv_Unit = "cup", "Pint", "Liter"; "Volume") without having to type "or serv_unit =" between values. Does this make more sense? Edited October 27, 2005 by Guest
RodOfNOD Posted October 27, 2005 Posted October 27, 2005 Not sure why u care about the or but you should be able to write your own function. Is this the extent of the cases or do u have more? Can you explain why you dont want to use the or?
Slobey Posted October 27, 2005 Author Posted October 27, 2005 Just a lazy typist I guess. Plus i thought I saw it done before where all the values could be grouped without adding the or and the field name before every value. I have many more values and I like to be compact and efficient. No big deal, if it can't be done without a custom function, I'll just keep it the way it is.
RodOfNOD Posted October 27, 2005 Posted October 27, 2005 Im not 100% sure but i think u could only do that with a custom function sorry.
Sanjai Posted October 27, 2005 Posted October 27, 2005 Slobley, No you cannot prevent entering the relationship name with each possible choice. In FileMaker Pro we cannot provide a case statement similar to C or VB where we could write: Select(re:serv_unit) case x,y setfield case .... I have written many big calculation fields like it. I would suggest since it is only a one time entry, enter it manually.
comment Posted October 27, 2005 Posted October 27, 2005 Try: Case ( Position ( "+Ounce+Pound+Cup+Gallon+" ; "+" & recipes::serv_Unit & "+" ; 1 ; 1 ) ; "Volume" )
RodOfNOD Posted October 27, 2005 Posted October 27, 2005 lol ugly as sin looking but very effective. As always where there is a will there is a way usually > good job
Recommended Posts
This topic is 7033 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