dbTalk Databases Forums  

calculation fails

comp.databases.filemaker comp.databases.filemaker


Discuss calculation fails in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
millerj
 
Posts: n/a

Default calculation fails - 11-15-2005 , 10:22 AM






I have a strange problem with a calculation. It seems to be working
for most "rows" in my table, but one set of rows fails, and I can't
figure out why. Can someone help me troubleshoot? Here's the set up.

I have two tables. The first, called COURSE, has two fields: Course
and Credit. The latter field lists the number of credits a student
earns for taking the course in Course. The Course field is related to
the Course field in another table. This second table, ALL, has a field
Students that stores the number of students. It also has fields for
Semester and year. What I want to calculate is the number of credits
generated by each course each semester, so I use a calculation field in
the ALL table that looks like "Students*COURSE::Credit". For every
course but one, this gives me the correct number, but for one course, I
get nothing. No number. When I fiddle with the course information in
the COURSE table (change the number of credits, reenter it into the
table, etc.) nothing happens. When I delete the row in COURSE that
defines that course, nothing changes, either. What could be going
wrong?

Thanks for whatever advice people can share. I know it's probably a
dumb question, but none of my references are any help.


Reply With Quote
  #2  
Old   
FP
 
Posts: n/a

Default Re: calculation fails - 11-15-2005 , 09:30 PM






If I understand correctly then your structure should be setup as:

COURSES
ID Course
Course Name
Number Of Credits
Selected Year_g (global field)
Selected Semester_g (global field)

STUDENTS
ID Student
Name

COURSE_STUDENT (cross table contains 1 record / student / course)
ID Student
ID Course
Year
Semester


To get the count of credits for a specific semester you would create a
new table occurrence of "Course_Student", call it "CS" and link it to
"Courses" so that
Courses::ID Course = CS::ID Course
Courses::Selected Year_g = CS::Year
Courses::Selected Semester_g = CS::Semester

Now you can create a calc in courses that gives you the correct count
whenever you select the year and semester. The calc =
Count(CS::ID Course) * Number of Credits

Note the count function could use any field in the CS table reference
that has data in it because it counts the record as 1 if it has data
and as 0 if it doesn't.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.