Hello everyone!
I got a problem which is pretty hard, but I am almost hundred percent sure I did the right thing.
First of all let me explain my database structure:
I have a collection called ships. Those ships complete journeys (one to many relationship). Each journey has multiple waypoints (one to many relationship).
In those waypoints the user can fill in it’s fuel consumption since the other waypoint, so add those consumptions to eachother and you will get the total consumption for the whole journey.
I want to show to total fuel consumption of last year per ship. So what I do is in a list of ships is the following: Current ship > Journeys > Waypoints > Consumption > Sum
. It shows nothing!
So I rechecked my database and it clearly shows the ship did one journey, in that journey where 3 waypoints with all a bit of consumption.
In order to test where the fault is I tried to just show the total amount of journeys the ship did, it correctly said 1. (Current ship > Journeys > Count
)
Then in order to debug the problem I made a list of journeys, in that list it showed the number of waypoints (3) correctly, and the consumption. (Current Journey > Waypoints > Consumption > Sum
)
But, when I try to do the exact same thing, but one level higher (so on the ship level, Current ship > Journeys > Waypoints > Consumption > Sum
) it doesn’t work again!
The problem might be in the fact that with the longer string (Current ship > Journeys > Waypoints > Consumption > Sum
) it has to first calculate the amount per journey and then add those values together, which might just not be possible yet.
I hope I informed you guys well enough to help me out on this one, if you have any more question please feel free to ask them!