Need Help in in Line Chart - Booking Project

Need Help in in Line Chart - Booking Project

  

Hello, 


I'm working on a Booking Project, at this part

Assignment 12: RichWidgets

4. Display the Occupancy for the Next 7 Days Issue

at c), which is 

In the Preparation, create the logic to build the data to be plotted on the chart:
• Get all Rooms in the hotel, to calculate the percentage of occupancy.
• Use a Local Variable to hold the Date to which the occupancy is calculated. The Variable should start on today’s date.
• If the Date in the Local Variable is within the next 7 days:
i. Get all Rooms Booked or Checked In on the date.
ii. Build a DataPoint with the percentage of occupancy for the date.
iii. Append the DataPoint to a List of Data Points.
iv. Add one day to the date on the Local Variable.
v. Define the flow to return to the If.

 

in the preparation of home screen, I create aggregate to get all rooms with (booked-check-in) status and I create a local variable TodayDate with currDate() as a default value.


But I did not understand what should I do then, could someone help me? 

and what should I assign to the SourceDataPointList in Line Chart?


Hi Ghada,

I allow that the description is a bit unclear :). What you need to do is build a loop that creates a list of DataPoints, for today and the next 7 days, something like this:

Hello Ghada,

  • You have to use your Local Variable as a Filter in your Aggregate. 
  • After completing the 5 steps (i to v) add one day to the Local Variable
  • Check if the Local Variable is still lower than `CurrDate()+7` (within the next 7 days): 

    True- complete the 5 steps, then add one day to the Local Variable; 

    False- move on to step d)

Regarding the chart itself maybe these examples in documentation will help you. 

Kind regards


Kilian Hekhuis wrote:

Hi Ghada,

I allow that the description is a bit unclear :). What you need to do is build a loop that creates a list of DataPoints, for today and the next 7 days, something like this:


Hello Kilian


I will show you what I do 

I did not create any logic like this before so I need a help on how to doing that

 I assign to the SourceDataPointList in Line Chart to be equal DataPointList

This is the flow of Home preparation:

and the local variable I have are :

and here is my work


but I think my problem in the aggregation which I create it like this:




and the result of my work is :



João Batista wrote:

Hello Ghada,

  • You have to use your Local Variable as a Filter in your Aggregate. 
  • After completing the 5 steps (i to v) add one day to the Local Variable
  • Check if the Local Variable is still lower than `CurrDate()+7` (within the next 7 days): 

    True- complete the 5 steps, then add one day to the Local Variable; 

    False- move on to step d)

Regarding the chart itself maybe these examples in documentation will help you. 

Kind regards



Hello João,

could you please see my replay above, and respond to me if you can :)

Thanks.

Hi Ghada,

These are my filters:

(the last one says Entites.Status.CheckedIn). Is that the problem with your filter, that you need a valid (non-empty) CheckOutDate?

Kilian Hekhuis wrote:

Hi Ghada,

These are my filters:

(the last one says Entites.Status.CheckedIn). Is that the problem with your filter, that you need a valid (non-empty) CheckOutDate?



I make this change then my result was changed which is:


in the assign, before ListAppend I make these assignments:


and my filter is the same as previous so my result is:

do you think my result is correct!

The result is correct if it displays the correct data. I don't know what's in your database :). Just debug it a little, and you'll find the numbers, right?

Kilian Hekhuis wrote:

The result is correct if it displays the correct data. I don't know what's in your database :). Just debug it a little, and you'll find the numbers, right?

Thank you for helping me
I appreciate that : )