Rich S Posted May 15, 2008 Posted May 15, 2008 Howdy, howdy: I have two calculation problems that are severely testing my last few brain cells; please refer to the attached. In the Trip Results box, I summarize some of the calculations in the Flight portal--one of them is average speed of the flights entered in the portal. The calculations (number) are: Total_Trip_Time = Sum(Flight_Data::Time_Leg) Total_Distance_Flown = Sum(Flight_Data::Distance_Flown) Average_Speed = Total_Distance_Flown / Total_Trip_Time As shown, Total_Trip_Time = 2.0 and Total_Distance_Flown = 34; both of these are correct. However, Average_Speed = 16.8. How on Earth did FM come up with that? It should be 17.0. The next question revolves around the Time_on_Engine field. The three-legged trip starts at 1110.0 and ends at 1116.0, so the total time is 5.0 hours; how do I code a calc to obtain that? I imagine I need to use GTRR, but I'm not sure. As always, your help is greatly appreciated. Cheers! Rich
mr_vodka Posted May 15, 2008 Posted May 15, 2008 My guess would be it has something to do with your time enroute calc field. You most likely have it set up to display to the tenth of a place but there is most likely more digits beyond it. So the total time is probably 2.02 or soemthing like that. As for your time engine you could use a calc such as, Max(Flight_Data::Engine_End) - Min(Flight_Data::Engine_Start) P.S. put in checks to make sure that the fields are not empty so that you dont get unwanted results.
comment Posted May 15, 2008 Posted May 15, 2008 1. John's guess is correct: your total time is actually 2:01 (2.0166666666666667 in decimal hours). 34 / ( 2 + 1 / 60 ) = 16.859504132231405 2. Another way would be: Last ( Flight::EngineEnd ) - Flight::EngineStart ) assuming the records are entered in order, or that the relationship is sorted.
Rich S Posted May 15, 2008 Author Posted May 15, 2008 (edited) Thanks, Mr. V and Comment! The engine calc works like a charm. As for the Time-Distance-Speed calcs, I tweaked the calcs by using the Round command( e.g., Round(Sum(Flight_Data::Time_Leg);1)) to clear things up. Thanks for the suggestion, too--it's a good one. Edited May 15, 2008 by Guest New reponse by Comment
Recommended Posts
This topic is 6096 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