Chuck Posted July 19, 2001 Posted July 19, 2001 I have a number field called Tuition. I have a summary field called Total_of_Tuition which is set to (of all things) Total of Tuition. I have a self-join relationship using a constant on both sides called SelfJoin~gConstant. I have a calculation field called Total_of_Tuition_All_Records with the following calc: Sum( SelfJoin::Tuition ) If the current found set is all records, shouldn't these two numbers be the same? They aren't for one of the fields (this method is used for a number of fields). For the calculation the value is 2,421,040.80. For the summary field the value is 868,079.16. This seems to work find for the other fields. The reason I'm using this method is that on a report they want not only the total for the found set but for all the records in the database also. I figured this would be an easy way to do it. Any thoughts? Thanks, Chuck
BobWeaver Posted July 19, 2001 Posted July 19, 2001 Why not make a calc field called ThirdOpinion = GetSummary(Tuition,Tuition) and see what result it comes up with. It might lead you in the right direction.
Chuck Posted July 20, 2001 Author Posted July 20, 2001 That would give the same thing as the calculation when all the records are found, but what I'm trying to do is get the sum of all the records in the database when only a subset is found. The GetSummary function wouldn't do that. Chuck
Bruenor Posted July 20, 2001 Posted July 20, 2001 whups, ignore this post. i did not see that you already had tried this. But actually, i tried doing this even when i had found a subset, and it still returned the total of all the records, so i guess i don't exactly understand what the problem is. what you can do is define a self-relationship based on a constant fields such as always1 (calculation) = 1 then the relationship will be always1 <=> file1::always1 and the related records will always be the set of all the records in the db. then to get the sum, you can define a calc field to sum the desired field in the related file. ~ati, jedi master [ July 20, 2001: Message edited by: Bruenor ] [ July 20, 2001: Message edited by: Bruenor ] [ July 20, 2001: Message edited by: Bruenor ]
BobWeaver Posted July 20, 2001 Posted July 20, 2001 Chuck: I just meant that since you seem to be getting to conflicting values when you are showing all records, one of them must be wrong. I thought that if you temporarily put in a getSummary(yada,yada) field you could see which one it agrees with in this case. And it might indicate what the problem is. If all records are found, then all 3 methods should give the same number. Just a thought. Is it possible that tuition has been defined as a text field?
Chuck Posted July 20, 2001 Author Posted July 20, 2001 Thanks Bob. I misunderstood. I did figure it out. After tracing the fields back to their origin (I dind't create this database system and it's a mess) I found that he was calculating the totals in a number of conflicting ways, and that was the origin of the discrepancy. Thanks for the input. Chuck
lgaray Posted July 28, 2001 Posted July 28, 2001 I have a problem related to summary fields. I have a total for season tickets sold in a found set (TotalQtySold=Total of QtySold), but I need to use this number for a calculation in a related file. I have added the TotalQtySold to the calculation but it seems to have no effect. How can I use a total from one file for a calculation in another file?
Recommended Posts
This topic is 8509 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