View VMF_BookingSnapshot

Card of view VMF_BookingSnapshot

Name

VMF_BookingSnapshot

Comment

Utility view used to generate VMF_RoomUtilization view using 'bookings' in our scheduling system. Depends on VMF_BookingSnapshotWithOverlap.

Dimensional Type

<None>


SQL query of the view VMF_BookingSnapshot

select
bswo2.MD_Date_SnapshotDate,
bswo2.MD_Room_SurrogateKey,
bswo2.MD_Time_SnapshotTime,
MAX(bswo1.MD_BItem_SurrogateKey) AS MD_BItem_SurrogateKey,
MAX(bswo1.MD_Event_SurrogateKey) AS MD_Event_SurrogateKey,
MAX(bswo1.MD_SType_SurrogateKey) AS MD_SType_SurrogateKey,
MAX(bswo1.MD_Sect_SurrogateKey) AS MD_Sect_SurrogateKey,
MAX(bswo1.MD_Building_SurrogateKey) AS MD_Building_SurrogateKey,
bswo2.MF_Booking_ExpectedAttendees
FROM
dbo.VMF_BookingSnapshotWithOverlap bswo1
INNER JOIN (
SELECT
MD_Date_SnapshotDate,
MD_Room_SurrogateKey,
MD_Time_SnapshotTime,
MAX(MF_Booking_ExpectedAttendees) AS MF_Booking_ExpectedAttendees
FROM
dbo.VMF_BookingSnapshotWithOverlap
GROUP BY
MD_Date_SnapshotDate,
MD_Room_SurrogateKey,
MD_Time_SnapshotTime) bswo2
ON bswo1.MD_Date_SnapshotDate = bswo2.MD_Date_SnapshotDate
AND bswo1.MD_Room_SurrogateKey = bswo2.MD_Room_SurrogateKey
AND bswo1.MD_Time_SnapshotTime = bswo2.MD_Time_SnapshotTime
AND bswo1.MF_Booking_ExpectedAttendees = bswo2.MF_Booking_ExpectedAttendees
GROUP BY
bswo2.MD_Date_SnapshotDate,
bswo2.MD_Room_SurrogateKey,
bswo2.MD_Time_SnapshotTime,
bswo2.MF_Booking_ExpectedAttendees


List of diagrams containing the view VMF_BookingSnapshot

Name

ViewsSpaceDiagram


List of view columns of the view VMF_BookingSnapshot

Name

Data Type

Comment

Length

MD_Date_SnapshotDate

 

 

 

MD_Room_SurrogateKey

 

 

 

MD_Time_SnapshotTime

 

 

 

MD_BItem_SurrogateKey

 

 

 

MD_Event_SurrogateKey

 

 

 

MD_SType_SurrogateKey

 

 

 

MD_Sect_SurrogateKey

 

 

 

MD_Building_SurrogateKey

 

 

 

MF_Booking_ExpectedAttendees