Hey guys,
I want to create a table that shows a total sales of each user
I have a data base called jobs that there I’m putting the data of the jobs include the close price and I have users table that each Job have a user assigned
I want to have a table that shows user on each row, and display total sales from the jobs table
(Status completed)
For example
User1 - 15000
User2 - 12000
User3 - 1100
Is it possible to do it or I need to create another table “sales” or something like that
Thanks
The :group by
operator is what you’re looking for
Group by allows you to group entries together if they share a common field. The most common usecase is exactly what you are asking for.
Use it in the Datasource of repating group, your final expression should look something like this:
Do a search for Jobs (Fetch all the jobs you want grouped): group by User (Inside the grouping, group by the user field, and add an Aggregation of type ‘sum’ on the close price field)
This will return a grouping, which has two values;
-User
-Sum of Close prices
Inside the repeating group you’ll then be able to display the grouping’s User’s Name and the Sum of Close Prices for each user.
Hopefully this helps, but there are a lot of useful guides on the :group by operator that could get you on the right track.
Thank you very much, I’m understanding the logic of it now.