Field from newest (sub)record
Dear experts
Can anyone help me? I am trying to budget and plan my revenue and have a table "Customers" and a sub-table "Years" in the sub-table Years I have a field "Total revenue" of this customer in addition to other data
Now I would like to display a field with the most recent "Total revenue" in the Customers table for each customer. I can solve this with last(years.total revenue) but it would be nicer and more correct not to simply take not the last record (although I probably enter the data chronologically in the correct order) but the total recenue from the year with the highest number of this customer. I can select the data record with max(years.year), but how do I select the „Total revenue“ field from this data record?
Sounds trivial, but I just can't do it. Many thanks for your help
Pascal
3 replies
-
You can do it in two steps:
let maxYear := max(year.year); year[year = maxYear].'Total revenue'
-
Thank you very much. I tried it in a similar way bit did not use the correct syntax. I a very grateful for your help.
Content aside
- Status Answered
- 13 days agoLast active
- 3Replies
- 27Views
-
3
Following