Sum week Work hours

 

Hello everybody,
I am a novice about apps and programming and I have very basic knowledge, just to start messing around with an app.
I have started a small app to manage shifts at work and I would need help to solve some things that I don't know how to solve:
1.- I would need to have a column with a formula that adds up the hours worked during the current week and that at the beginning of the following week it will restart and add up the week's entries again.
2.- I would need the same to add the hours you work during the month.
3.- How can I use these results independently to express it in a UX view.

Thanks in advance and best regards.

Solved Solved
0 4 229
1 ACCEPTED SOLUTION

1. Weekly sum: 

  • Date of Monday this week: TODAY() - WEEKDAY(TODAY()) + 2

  • Expression to sum worked hour this week:
    SUM( SELECT( table[hours],
      [date] >= TODAY() - WEEKDAY(TODAY()) + 2
    ))

2. Monthly Sum:

  SUM( SELECT( table[hours],
    MONTH([date]) = MONTH(TODAY())
 
))

 

View solution in original post

4 REPLIES 4

To start to help do you want to share with us what columns and tables you have the moment?

Hello @1minManager ,

thanks for your help. This is the table and columns I am using. Greetings,

Columns1.jpgColumns2.jpgColumns3.jpgTable.JPG

1. Weekly sum: 

  • Date of Monday this week: TODAY() - WEEKDAY(TODAY()) + 2

  • Expression to sum worked hour this week:
    SUM( SELECT( table[hours],
      [date] >= TODAY() - WEEKDAY(TODAY()) + 2
    ))

2. Monthly Sum:

  SUM( SELECT( table[hours],
    MONTH([date]) = MONTH(TODAY())
 
))

 

Thanks @Joseph_Seddik , this is good for me.!

Top Labels in this Space