October 27, 200520 yr 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
October 27, 200520 yr 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.
October 27, 200520 yr Author 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, 200520 yr by Guest
October 27, 200520 yr 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?
October 27, 200520 yr Author 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.
October 27, 200520 yr Im not 100% sure but i think u could only do that with a custom function sorry.
October 27, 200520 yr 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.
October 27, 200520 yr Try: Case ( Position ( "+Ounce+Pound+Cup+Gallon+" ; "+" & recipes::serv_Unit & "+" ; 1 ; 1 ) ; "Volume" )
October 27, 200520 yr lol ugly as sin looking but very effective. As always where there is a will there is a way usually > good job
Create an account or sign in to comment