Count in a list

0
Hi, a have an entity with several bookings for several rooms. How can I get a list (data grid) of bookings that says: For room 4711 today 10 bookings For room 4712 today 2 bookings For room 4711 tomorrow 4 bookings   I tried it with the counter but was only able to count all bookings. ;-)    
asked
2 answers
0

Hi Tjark Radewaldt,

You should try to follow link https://docs.mendix.com/howto/data-models/denormalize-data-to-improve-performance

 

answered
0

A piece of a possible solution:

You could count the number of bookings for a room using an aggregate function in a datagrid. For this, you do have to change the association to a many-to-many, refering to each other.

https://docs.mendix.com/refguide7/columns#aggregate-function

“today” and “tomorrow” are relative to current datetime, this is tricky, also given timezone issues. You may want to consider if that is essential enough to be worth the trouble.

answered