8 Replies Latest reply on Feb 9, 2015 12:02 PM by PradeillesThomas

    Summary based on relationship



      Summary based on relationship



      I'm playing with summary and there is something I'm stuck with.

      I created two tables :

       - Portion : Each time a user eat a fruit, a new record is created with thoses fields :

               - id  : unique id

               - date : creation date

               - user_id : id of the user   (linked to the table User, on field id)

               - fruit_id  : id of the fruit    (linked to the table Fruit, on field id)


         - Fruits : It's basically a definition table, that is a list of fruits

               - id : unique id

               - name : name of the fruit (ex. apple, peach, etc...)


      I want to get a set of summary fields in the table "Portion" that will tell me how many apple this user ate, how many peach and on many fruits in total. I found my way to display the total of fruits, but I can't find my way to display a total filtered on each fruit id. Note that I want this to be stored in a field in the table, I don't want simply to display it on on layout inside a portal.


      Any idea ?


      Thanks a lot.