hey all, hope somebody can help. What I am trying to do is very simple I am sure, but I think I must have brain fog as I've stumped myself!
To keep it easy, I have three key tables: 1) Days (where each record is a unique date) where lots of other information is held in other fields. 2) Foods (with a list of possible foods that can/have been consumed) together with extra information such as calories etc.. and 3) Meal Names ('Breakfast, Lunch etc).
In the middle of the 3, I essentially have a join table 'Food Line Items' to allow many-to-many relationships between them all. ie. each meal can have multiple foods, each day can have multiple meals etc.
This means that for each day, each food item consumed is added on a portal on the 'Day' form which I can sort by time etc... The user can also add which Meal name it relates to from a drop down menu linking to the Meal Name table. This all works fine.
What I need help on is this:
From each of the 3 key tables, there is a direct relationship with the Food Line Items table. This also works fine so for each day/meal name or Food, I can easily see all the relevant related food items.
But I'd also like a summarised version. I could easily do it in a report using summary, sub summaries etc.. But want it live in a second portal. So on the Day form, the existing detail portal would show every food item, but the new summary one would simple show 'Breakfast - x, Lunch - y, Dinner - z etc..
I have tried so many ways. I have tried using so many combinations if If calculations, self joins, GetSummary fields but no luck. I can get each meal in a separate field but that will look a bit rubbish in the portal with up to 7 different meal types. Ideally I want it in just one field which summarises for each meal on each day, the total number of calories of related line items.
Hope this is clear. Hope somebody can help 🙂
Davinity x