22
Views
13
Comments
occupancy rate line chart
Question

im really stuck ,wht needs to be done next, to achieve line chart for next 7 days

UserImage.jpg
udvisha kosti

thankyou, but the flow is quiet different feom mine and im unable to create the screen action flow 

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @udvisha kosti ,

You need to use a Data Action to fetch records using the ListFilter. Set its output to a list type and use that list as the source for the chart.

UserImage.jpg
udvisha kosti

can u plz show me the flow to achieve occupancy rate for next seven days


2026-01-28 16-57-48
Mihai Melencu
Champion

I assume you want the chart to show occupancy for each of the next 7 days, meaning you'll need 7 data points, one per day. To achieve this, you can use a traditional loop with an If to calculate the value for each day.

If you can share your OML, I’ll be able to give you a concrete example based on your actual data.

UserImage.jpg
udvisha kosti
Booking_Core.oml
UserImage.jpg
udvisha kosti
2026-01-28 16-57-48
Mihai Melencu
Champion

Alright, as mentioned earlier, you can use a traditional loop starting from index 0. Use an If to calculate values for each of the next 7 days. Use your existing aggregate in a Data Action and filter it for each specific day. For every iteration, filter the bookings for that day and append the result to a list, which you'll then use as the chart's data source. 

Result:

Booking_UI (1).oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

this calculates the number of checkins on a given date, not sure that's what is desired for a chart of occupancy.  It also won't correctly show checkins on day 7 where the checkout is after day 7, as those won't come out of the aggregate due to the 3rd filter.

Don't have time now, but I'll take a look tonight.

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi, thanks for pointing out the issue. I'm not sure what the expected range is, whether it's the next 7 days starting today, or from today through the end of next week (which would be 8 days). It might make more sense to treat this as a weekly chart.

For occupancy, if bookings aren’t the right metric, I believe it should be the total number of guests (adults + kids).

I’ve updated the OML so it now uses the number of guests. As for the other filter, it’s from the original OML and no further details were provided.

@udvisha kosti It would be helpful if you could clarify the actual requirement behind this. 

Booking_UI.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

yes, number of guests is also interesting, i think, as a user, I would like insight in number of guests (for staffing of the bar) number of rooms booked (for staffing of room services) number of children (for staffing of child activities).

But that's not the point I was trying to make, the logic is only going to be correct if everybody only stays 1 night, because your filter only looks at the checkin date being equal to a given date, but if someone is booked for the first 3 days of next week, it should count on all 3 as occupancy, not only on the first day. 

The chart now only gives an idea how much front desk staffing is needed to do the checkins

2021-09-06 15-09-53
Dorine Boudry
 
MVP

to show what i mean :

(I am making the assumption that bookings don't contribute to occupancy on the checkout date)

filter in aggregate should be something like

and filter in ListFilter within loop should be something like

Also, the ListAppendAll doesn't make any sense to me, it should be a ListAppend.

And just as a spielerei, I also explored an option where we have a 'calendar' entity, so we can solve the entire thing inside a single group by aggregate, without having to apply filters in a loop afterwards.

See my attached changed OML, actions Get7DaysOccupancy and Get7DaysOccupancyInSingleAggregate.

Dorine


Booking_UI Dorine.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.