Skip to main content
Question

Sum Overlapping Time/Remove Timeframe Gaps

  • September 3, 2024
  • 0 replies
  • 210 views

Forum|alt.badge.img+6

Hi all, is there a way to do this formula queries? I have a table of people who have child residence & employment records, with start & end dates for each, as well as a numeric field that summarizes each timeframe in months. I need to query for all child residence & employment records related to each person, find any potential overlapping timeframes between the 2 tables based on start & end dates, and sum the total # of months from the Duration (months) field from applicable records. 

Essentially I need a final number in months of time each person provided to us across 2 tables, so any overlapping time would basically get deduped out. I also need it to be smart enough to recognize some of these timeframes are not contiguous and contain gaps, so we might not have any date for particular person from 2010-2015, but we do from 2005-10 and 15-18, so any gaps would need to be excluded from the final count. 

This topic has been closed for replies.

Forum|alt.badge.img+15
  • Registered
  • September 4, 2024

Do you need a total for all time or will you have to specify specific periods?

For a small number of records in the People table I think I have a solution.  If there are thousands of People than a solution is in order.


MarkShnierYou
Forum|alt.badge.img+24

Would it be OK to bucket the analysis into say monthly buckets? Say you made 36 monthly buckets for the last 36 months? There may be a solution if we use that approach. It's brute force with 36 or 72 summary fields, but that might work.


Forum|alt.badge.img+15
  • Registered
  • September 5, 2024

The most elegant solution is Tableau or PowerBI.   This has alot of potential out comes and if your reporting requirements expand, it might be very hard to get new data.

For a pure Quickbase solution, I would create three fields on each person.

2 mile count

3 mile count

4 mile count

At the end of the month I would have a Pipeline go through your child tables and then update the count on the Person table.    You will need to do a Search inside of a Search to check both child tables and then if either or both are true, only add one more month to the appropriate field for the totals.