The logic can be simplified to:
age < 365 ; "Calf-" & sex ;
age<730 and sex = "female" ; "Heifer" ;
age<730 ; case( Castration = "Yes"; "Steer/Tollie" ; "Young Bull" ) ;
sex = "female" ; "Cow" ;
case( Castration = "Yes"; "Ox" ; "Bull" )
Thanks to come to my aid. The calculation works fine for categorizing "Calf-Female", "Cow", "Bull" etc. But now my problem is that I also want a grouping that is only composed of "Cow" and "Heifer" so that I can use that in the drop-down list.
I would stay away from the computer and try to use a speadsheet or other tool to make sure you have all your cases considered. When you say "Grouping", perhaps you need to group your data in different ways too.
I find that going to the computer to quickly when I haven't thought things through completely and have all the cases working on paper (or spreadsheet) means I will spend MORE time, not less.
You could also have a database design issue. Not sure, but many problems listed on this forum, where people are asking for "script help" are really database design problems that are trying to be fixed by "clever coding". If your database reflects your situation, things usually will work easily. If your database isn't correct, say, you have the wrong relationships, or even the wrong basic design, scripts will take forever and never solve the actual problem.
HOPE THIS HELPS.
Fmdude, thanks for your advice, but I think you misunderstood me. If you have started from the beginning the thread my question could be clearer.
Sorry I wasn't clear. I was really only saying that you need to figure out the cases up front you try to implement them in FM (or any programming environment).
In your "original posting", you included a FM file, not a spreadsheet or other documentation listing all combinations you need. When you have lots of Boolean choices, it can get confusing -- especially if you're heads down trying to implement something that's yet to be fully documented.
Some folks are "top down", like me, and others like to "jump in" and start coding. My experience on large projects is that the folks that "jump in" end up having lots more problems than the folks who figure out things up front.
As an example, would you have a builder build your dream house without blueprints? The "construction metaphor" is totally applicable to serious software development.
HOPE THIS HELPS.
1 of 1 people found this helpful
You might want to add a new calculation field to indicate pregnancy (or eligibility?) ... a Boolean number field equal to (age > 365 and sex = "Female"). 0 = not female and/or too young
David! That sounds like the direction worth running to. Why couldn't I think of something like that. When the mind goes blank it just can not rescue itself. THANKS !! I will give it a try.
T H A N K ! ! ! ! What took you so long. I struggle for almost two weeks trying my best to understand a variety a value list, when the solution was in my own formula! I will definitely follow you, just always keep an eye on me if I not somewhere drowning in FM intricacies