In tha tableMethod 1
Create the summary fields to total consumption of each faith and the use the Getsummary() function to place the totals in a calculated field works but calculation can be slow over a large table.
Create a Fruit_Consumption table (a "join" table) containing all pairs of user_ids and fruit_ids - linked in between the users and portions tables. (If you set the records to autocreate a new paring can be created if needed need whenever a user picks a fruit.)
In that table add a Count(portions::id) -- it will sh the suers fit totals - much faster, and a better design .
Hello, thanks for your answer, but I don't get the idea.
Let's say I do the second way, the one you say is better. The Count(portions::id) will actually give me the total number of all fruits consumed, but I want a total per fruit (total apple, total peach, etc).
I should have been clearer - sorry :)
If you link the join table to portions using both the user id and the fruit id it will give you the totals by user x fruit
Thanks again, I'm trying without success (See relationship joined).
In this configuration, in user context, total field will alway give me the total number of record for this user, whatever the fruit is. And i don't see how it could be different, there is not way for the base to filter this table on fruit_id in this configuration.
Would be easy if I could add a filter in Summary field option, like : Count(fruit_id when fruit_id = 0)
total is not a summary field, but a calculation:
Each record with have the # portions for that fruit and user
Well I can't get it working :(
Base sent. Thanks for your patience.