May 15, 200817 yr 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
May 15, 200817 yr 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.
May 15, 200817 yr 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.
May 15, 200817 yr Author 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, 200817 yr by Guest New reponse by Comment
Create an account or sign in to comment