Total value of each user monthly

Hello!

I’ve been trying to solve my problem for days consulting old posts about this subject, but I’m probably loosing something back.

My goal is obtain the total value of each worker monthly and put it on a list on the screen.

Note that there are different values for each Working Hour and each worker appears in several rows with their respective values in the All Income column.

I have already created a multiple Relation from User to User; I created a User ID (worker) Template with the date (month and year); finally I tried a Rollup through this Relation, but the SUM option does not appear, only Count and Count Unique.

I hope you can help me.
Thank you in advance.



Instead of trying to sum through the lookup (which you don’t need), you should be able to sum directly through the multi-relation.

If you still don’t see an option to sum, you need to examine the source of that single value column and check that it is actually a number type.

Also, you can probably replace that multi-relation, the template and associated columns with a single Query column.

3 Likes

The problem was at the source, thank you very much!

Finally, now that I’ve managed to sum the final values, what would be the best way to view each user per row and select by month?

Plenty of ways to approach this, can you describe in a little more detail your desired user experience, and how you would want the data presented?

  • On which screen would the data be presented? On each users details screen, or some generic screen where you could select from a list of users and months?
  • Would you just be viewing one user at a time, or would you want to view all data for all users for a selected month? (or conversely, all data for a single user for all months?)
2 Likes

On a new screen, the administrator should be able to view and select from a list of users and months.

On each user’s details screen, only their own earnings for the current month should be displayed.

For this one, I would do it as follows:

  • Create a single row Helper Table, and add a RowID column, plus two User Specific text columns; one to hold a UserID (or email), and one to hold the Month selection.
  • Sit a screen on top of that table and add two choice components - one for the User selection and one for the Month selection.
    – For the month selection, you can probably make use of those two columns you already created (Y, M). Maybe create a template from those and use as the choice source. There are better ways to do this, but you may as well make use of what you already have.
  • Add a Query column to the Helper Table. Target it at the data table and apply the following filters:
    – User is This row->User
    – Month is This row->Month
  • Add a Rollup->Sum that targets the Query column.

I would do this in the User Profile table:

  • Create a Math column that returns the Date of the first day of the current month: Now - Day(Now) + 1
  • Add a Query column that targets your data table, and apply the following filters:
    – User is This row → User
    – Date is on or after This row → 1st of month (the previous math column)
  • Add a Rollup->Sum that targets the Query column.
4 Likes

I followed all the steps in both cases, but the result of the Rollup sum is always zero.
What could be wrong?

If you trace backwards through the steps, where does it fall apart? Does the query have matching rows? If you trace backwards, what is the first step that doesn’t have the expected results?

2 Likes

As Jeff said, the way to debug is to trace backwards.
If you show a couple of screen shots, we may be able to pinpoint the failure point pretty quickly.

1 Like

Helper Table 1

Helper Table 2

User ID Table

In your Query column, it looks like you are trying to match an email address to a users name. That won’t work. You need to match like wth like.

2 Likes

Try to remove filters one by one to see which one prevents rows to be appearing in query. For now, no one row meet your filters

2 Likes

Exactly, thank you so much for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.