How to create the performance analytics for start and end date time field

Akshaya14
Tera Contributor

Hi Team,

I have a requirement to create performance analytics dashbord

case 1: I want to calculate percentage utilization of Workplace reservation based on Start and end field. Like I need to calculate total time utilization for ex: Reservation 1->1 hr, Reservation 1->2 hr, Reservation 1->3 hr for day working hrs = 8hrs so %utilization like hrs in use/total potential hrs

Akshaya14_0-1696950665190.png

Case 2: In which region of a floor have higher utilization use 

 

2 REPLIES 2

AndersBGS
Tera Patron
Tera Patron

Hi @Akshaya14 ,

 

Where do you have issues in creating the above two use cases? which issues are you facing?

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Tai Vu
Kilo Patron
Kilo Patron

Hi @Akshaya14 

Let's try below approach.

  1. Define an Indicator Source in the Workplace Reservations table with your own conditions. (Make sure you include the date corresponding with the frequency)
  2. Create an Automated Indicator (ex: Daily)
    • Select Aggregate as SUM
    • Scripted is True
  3. Create new PA Script. Sample below
var diff=function(x,y){return y.dateNumericValue() - x.dateNumericValue();};
var hours=function(x,y){return diff(x,y)/(60*60*1000);}; //Convert to hours
hours(current.start, current.end); //Your start and end date fields

 Then execute the Collection Job to collect data for the Indicator.

 

Now, you have an Indicator of "Total Hours of Reservation (Daily)". So if you'd like to have the percentage of utilization, go ahead and create one more Formula Indicator. Sample Formula below:

([[Total Hours of Reservation (Daily)]] / 😎 * 100

 

Let me know if it works for you

 

Cheers,

Tai Vu