View VMF_BookingSnapshotCoverage

Card of view VMF_BookingSnapshotCoverage

Name

VMF_BookingSnapshotCoverage

Comment

Used to calculate room utilization levels over time using 'bookings' in our scheduling system. Used to generate VMF_RoomUtilization view, in conjunction with VMF_BookingSnapshot and VMF_BookingSnapshotWithOverlap.

Only looks seven days into the future, because this view is mainly used in cubes whose job it is to tell us what has happened, not what we think will happen.

Dimensional Type

<None>


SQL query of the view VMF_BookingSnapshotCoverage

select
   mdd.MD_Date_DateInteger AS MD_Date_SnapshotDate,
   mdt.MD_Time_TimeInteger AS MD_Time_SnapshotTime,
mdr.MD_Room_SurrogateKey,
ISNULL(MAX(mdb.MD_Building_SurrogateKey), (SELECT MD_Building_SurrogateKey from MD_Building WHERE MD_Building_ID = 'UNKN')) AS MD_Building_SurrogateKey,
MAX(mdr.MD_Room_CapacityExact) AS MD_Room_CapacityExact
FROM
   (SELECT MD_DATE_DATEINTEGER
    FROM dbo.MD_DATE
    WHERE MD_DATE_SQLDATE >= DATEADD(yy, -1, GETDATE())
      AND MD_DATE_SQLDATE <= DATEADD(dd, 7, GETDATE())) mdd,

   (SELECT MD_TIME_TIMEINTEGER
    FROM dbo.MD_TIME
    WHERE MD_TIME_SECOND = 0
      AND MD_TIME_MINUTE = 0) mdt,

   (SELECT DISTINCT m1.MD_ROOM_SURROGATEKEY, m1.MD_ROOM_BUILDINGID, m1.MD_ROOM_CAPACITYEXACT
    FROM dbo.MD_ROOM m1, dbo.MF_BOOKING m2
    WHERE m1.MD_ROOM_SURROGATEKEY = m2.MD_ROOM_SURROGATEKEY
-- AND m2.MF_Booking_SchedulingSystem = 'EMS'
      AND m1.MD_ROOM_CAPACITYEXACT IS NOT NULL
AND m1.MD_ROOM_CAPACITYEXACT > 0) mdr
   INNER JOIN dbo.MD_BUILDING mdb
   ON mdr.MD_ROOM_BUILDINGID = mdb.MD_BUILDING_ID
GROUP BY
   mdd.MD_Date_DateInteger,
   mdt.MD_Time_TimeInteger,
mdr.MD_Room_SurrogateKey


List of referenced objects of the view VMF_BookingSnapshotCoverage

Name

MD_Building


List of referencing views of the view VMF_BookingSnapshotCoverage

Name

VMF_RoomUtilization


List of diagrams containing the view VMF_BookingSnapshotCoverage

Name

ViewsSpaceDiagram


List of view columns of the view VMF_BookingSnapshotCoverage

Name

Data Type

Comment

Length

MD_Date_SnapshotDate

 

 

 

MD_Time_SnapshotTime

 

 

 

MD_Room_SurrogateKey

 

 

 

MD_Building_SurrogateKey

 

 

 

MD_Room_CapacityExact