faaslave Posted September 26, 2006 Posted September 26, 2006 I have two tables Project ----- Tasks On the project layout I have a portal listing all the tasks task completed date What I want to do is have a calc field in the project table that looks at all of the tasks for this project, and if they are all completed, finds the most recent date, then plugs it in that field. How can I do this? Thanks Dave
Søren Dyhr Posted September 26, 2006 Posted September 26, 2006 Given the rather limited description, is here what I came to think of... --sd ProjTask.zip
faaslave Posted September 26, 2006 Author Posted September 26, 2006 Thank you for your answer Soren. You are right, I was not specific enough. The portal looks like this clean house 5/14/06 clean yard 5/17/06 mow lawn 4/30/06 paint fence 5/1/06 So the field I need, would see that they are all done, and have "5/17/06" as a result. Thanks Dave
comment Posted September 26, 2006 Posted September 26, 2006 Use the same principle with what you have, e.g. Case ( Count ( Tasks::ProjectID ) = Count ( Tasks::Completed ) ; Max ( Tasks::Completed ) )
faaslave Posted September 26, 2006 Author Posted September 26, 2006 That is Great!! Thanks to both of you. Dave
faaslave Posted September 26, 2006 Author Posted September 26, 2006 One more question, Using my example above, lets say that you wanted a calc that showed when the lawn was mowed. I tried this, but it doesn't work. Case ( (tasks::Tasks) = "mow lawn" ; (tasks::completeddate) ) I ould have thought this would work. Dave
comment Posted September 26, 2006 Posted September 26, 2006 It won't work because (tasks::Tasks) refers to the field 'Tasks' in the FIRST related record in the 'tasks' TO. What you want is a reference to the contents of the field in ALL related records. It's possible to do this, but the question is what is so special about lawn mowing? Will you always want the last date of lawn mowing, and lawn mowing only, or is this needed for other tasks as well? For example, you could define a special relationship that filters the tasks by selected type of task, and show the last date of that type only.
faaslave Posted September 27, 2006 Author Posted September 27, 2006 It's possible to do this, but the question is what is so special about lawn mowing? LOL, I just used that as an example. I really am tracking something more important. I just wanted a way to grab the date of a particular task to be used on a layout. To be more specific, an employee must complete several of these tasks to be re-certified. One task is, recertification. The recertification date is important because it reflects when the employee could work again. So I wanted a way to have a calc field that grabbed that date, so I could have Employee recertified on (the field) displayed I guess from what you are saying, it is not possible without some kind of relationship. I am not sure how I can achieve that. I attached the file. Look on the Op Event layout, and I think you will get abetter idea of what I am doing. Thanks Dave SupTracking39.fp7.zip
comment Posted September 27, 2006 Posted September 27, 2006 It's possible with a relationship, it's possible with a value list, it's possible with a custom function... I just think a relationship might be the easiest one - and even here there are several ways to do it. See the attached for one of them. SupTracking39a.fp7.zip
faaslave Posted September 27, 2006 Author Posted September 27, 2006 I see, so the cCalculation field only gets records that match the criteria, then you built the relationship so that those were the only records that would be seen via the relationship. Now the calc finds the most recent one if there were multiple records. I love it when I learn something. I just wish I could futher my learning at a college class, etc. There aren't many good options for learning outside of books. And one other thing, the Calc and scripting books available, really don't go into enough detail when explaining each function. I think they assume you are a programmer. I would love for someone to come out with a book of all the calcs, and break them down in layman's terms, with a multitude of examples so a non-programmer could make sense of it. I am so glad this site is here and people like you take the time to help us hackers figure out these puzzles. You are truly one of the masters on here. Thank you very much, Dave
Søren Dyhr Posted September 27, 2006 Posted September 27, 2006 And one other thing, the Calc and scripting books available, really don't go into enough detail when explaining each function. I think they assume you are a programmer. I would love for someone to come out with a book of all the calcs, and break them down in layman's terms, with a multitude of examples so a non-programmer could make sense of it. Is this Chis Kubica's book: http://www.amazon.com/Automating-FileMaker-Pro-Scripting-Calculations/dp/0122513371/ref=si3_rdr_bb_product/002-3337326-9035249?ie=UTF8 ...well I havn't read it myself, but I know Chris from the debates fora. What I know is that he while writing the book made a call for all developers to come forward with their best stuff - so the book is the one closest to this topic! But how much that worth? - your line of questioning not new to this forum... Your question is a little like asking 'Has anything substantial been written about Filemaker and addition?' The answer is no, there is no need as the concept of addition and variables has already been very well defined in math. ...really nailed it, snipped from: http://www.fmforums.com/forum/showtopic.php?tid/177813/post/210539/#210539 The real understanding is still what you achieve or learn by experimenting. Something you shouldn't ignore is that the best learners are teachers ... so picking up questions from a forum like this one and trying to give some kind of answer learns you a lot ...and when it comes to it, is it the curveballs you learn the most from. What you probably miss from book'ed learning is the "interpolative and probabilistic process" that with a bit luck occationally happens in a classroom, when the teacher is trying the students way of reasoning. Snipping was done from this: http://www.systems-thinking.org/dikw/dikw.htm Which is very important distinctions to make, because spindoctors and lobbyist for filemaker or other tools simply makes a living in confusing these. There is no guarantee that say a certification makes you a better troubleshooter. Because the aim is the opposite ...spin is namely designed to make you demand inclusions of features in the tool, balancing on the edge to still keep you loyal to the product as such, by carefully choosing the wording. Troubleshooting, optimization and thinking up workarounds is nothing you can learn from reading ...some simply gets the ideas faster than others, but you can get somewhere by being keen on exercising and tearing other developers templates appart. The worst sin here is apply something as a fix to a problem, if you don't get the gist of approach utilized. Especially should you be cautious if feel you're on shaky ground and someone in sheer eagerness provides you with a quick fix to a problem - This is a sign of spin! No one with honest intentions approches anything without questioning, eventhough it could be considered rude or irritating impolite hairsplitting to reply with yet another question. --sd
Recommended Posts
This topic is 6631 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