Hi
I have a question I have been working for a while and it would be really nice if I could have a hint.
Sorry if I go straight to the problem:
I have few teachers working in a school.
The event to consider is the lesson.
I want to count how many days is the teacher coming in a month to pay the transportation. If the teacher come 2 times or more in one day the transportation is payed just one time.
Sometimes the lesson is cancelled from the student.
In this case the teacher do not come but the lesson is payed.
In fact I want to count the times the teacher is coming per month.
But of course I do not want to count the cancelled lesson.
So if there is just on cancelled lesson in one day means the teacher did not come. If there are 2 lessons in one day and one lesson is cancelled means the teacher come. If there are 2 lessons and both are cancelled means the teacher did not come....
I hope it is easy to understand
Many many many many many thanks in advance
Stefano
How many days is the teacher coming?
3 posts
• Page 1 of 1
Posts: 5
Joined: Sun Nov 01, 2009 2:51 am |
|
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am |
Hi Stefano,
So first you want to script a find on the appointment list or table that gathers all the records you want to count. So you'll write a find that looks for appointments in the particular month, for that teacher, omitting cancels. Now you have a list of appointments though you may have the same day there twice. Sort this list by date. Now all you have to do is count the unique dates. This is probably easiest in a looping script: start at the first record add its date to your counter (which is probably a $variable), go to the next date. If the next date is the same as the last date, skip it and go to the next record. If the date is new, increase your counter by one. There are also come custom functions that can do this counting if you're using FileMaker Advanced. Check out this for unique values: http://www.briandunning.com/cf/596 And this for gathering the list of dates from your found set to feed into the previous function: http://www.briandunning.com/cf/868 Hope that helps get you started. John Sindelar
SeedCode |
Posts: 5
Joined: Sun Nov 01, 2009 2:51 am |
Thank you John,
you are always very nice. I think I will try with the last solution as I have the advance version. I got so busy lately. Let me have a go this weekend. I still have also to work with the window size. I will let you know as soon as I will do it. Thanks again STefano |
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests