mjennings061 / viking-log-keeper

661 VGS - Collate gliding log sheets into a database and visual dashboard.
https://viking.streamlit.com/
MIT License
5 stars 0 forks source link

Provide quarterly summaries #19

Closed mjennings061 closed 6 months ago

mjennings061 commented 1 year ago

As a pilot, I want to have a quarterly summary provided by this program, so that I can save time calculating my launches for the quarter.

Required outputs:

Possible implementation:

mjennings061 commented 8 months ago

Possible SQL solution:

  1. Use a WHERE "AircraftCommander" == name
  2. Use a WHERE "2ndPilot" == name AND ("Duty" == "SCT U/T" OR "Duty" == "SCT QGI")
  3. Use a UNION to link the two tables
mjennings061 commented 8 months ago

MongoDB charts does not support this level of grouping. A separate collection should be created as a summary for each pilot The processing should be done in python to do the following:

for name in AircraftCommander: 
   select where AircraftCommander == name in log_sheets as commander
   select where SecondPilot == name in log_sheets as second
   select where Duty is AGT, SCT U/T or SCT QGI in second
   union commander and second
   add to "Pilot" collection under name