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

    Summary based on relationship

    PradeillesThomas

      Title

      Summary based on relationship

      Post

      Hello,

      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.

      Screen_Shot_2015-02-09_at_9.40.50_AM.png