Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
How to fix Daily & Weekly summary pre calculation in database?

Daily & Weekly Steps along with their Summary are pre-calculated & stored in DB

  • Records logged on the different timestamps on a given day get summed.
  • Ex. On Monday, if a member logs 400, 500, 600, 1000, 500. The total steps on Monday will be 3000

Ex. If user A has set the daily target of 1000 steps & total steps for the current week stored in DB are as follows. Weekly average: Daily Sum / 7 = 1000 steps

{
    Monday: 1500, Tuesday: 0, Wednesday: 2500, Thursday: 2000, Friday: 0, Saturday: 0, Sunday: 1000
},

When the member changes the profile timezone, the summarised daily records stored in DB create an issue:

Weekly records in the previous timezone
 = {
    Monday: 1500, Tuesday: 0, Wednesday: 2500, Thursday: 2000, Friday: 0, Saturday: 0, Sunday: 1000
},
Weekly records in the current timezone = {
    Monday: 1500, Tuesday: 500, Wednesday: 2000, Thursday: 2000, Friday: 0, Saturday: 500, Sunday: 500
},

But, as we have pre-calculated & stored the data in DB. We are displaying the data based on the previous timezone. How to resolve this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!