View VMF_ReadingByHourAccumulating

Card of view VMF_ReadingByHourAccumulating

Name

VMF_ReadingByHourAccumulating

Comment

See documentation on MF_ReadingByHourAccumulating in the StarsEnergy package.

Dimensional Type

Fact


SQL query of the view VMF_ReadingByHourAccumulating

select
MD_Point_SurrogateKey,
MD_Date_DateInteger,
MD_Time_TimeInteger,
mfr.MD_Unit_SurrogateKey,
MD_ThingM_SurrogateKey,
MD_Source_SurrogateKey,
MD_Vend_SurrogateKey,
MD_Building_SurrogateKey,
MD_Room_SurrogateKey,
MD_MQual_SurrogateKey,
MF_ReadHourAcc_Value,
MF_ReadHourAcc_Coverage,
CASE WHEN MD_Unit_Name = 'Seconds' THEN MF_ReadHourAcc_Value ELSE NULL END as VMF_ReadHourAcc_Seconds,
CASE WHEN MD_Unit_BtuConversionFactor IS NOT NULL THEN MF_ReadHourAcc_Value * MD_Unit_BtuConversionFactor ELSE NULL END as VMF_ReadHourAcc_ValueInBtus,
CASE
WHEN MD_Unit_BtuConversionFactor IS NOT NULL AND MF_ReadHourAcc_ApplicableSqFt IS NOT NULL AND MF_ReadHourAcc_ApplicableSqFt <> 0
THEN (MF_ReadHourAcc_Value * MD_Unit_BtuConversionFactor) / MF_ReadHourAcc_ApplicableSqFt
ELSE NULL
END as VMF_ReadHourAcc_BtusPerSqFt
from
MF_ReadingByHourAccumulating mfr
INNER JOIN MD_UnitOfMeasurement mdu
ON mfr.MD_Unit_SurrogateKey = mdu.MD_Unit_SurrogateKey


List of outgoing view references of the view VMF_ReadingByHourAccumulating

Name

Parent Table/View

ViewReference_181

VMD_Building (Shortcut)

ViewReference_182

VMD_MeasurementQuality

ViewReference_183

VMD_TimeToHour

ViewReference_184

VMD_Date (Shortcut)

ViewReference_185

VMD_Vendor (Shortcut)

ViewReference_186

VMD_Room (Shortcut)

ViewReference_187

VMD_Source

ViewReference_188

VMD_ThingMeasured

ViewReference_189

VMD_UnitOfMeasurement

ViewReference_190

VMD_Point


List of diagrams containing the view VMF_ReadingByHourAccumulating

Name

ViewsEnergyDiagram


List of permissions of the view VMF_ReadingByHourAccumulating

Grant

User

SELECT,VIEW DEFINITION

EnergyReader


List of view columns of the view VMF_ReadingByHourAccumulating

Name

Data Type

Comment

Length

MD_Point_SurrogateKey

numeric

 

 

MD_Date_DateInteger

 

 

 

MD_Time_TimeInteger

int

Integer representing the time of day in the format HHMMSS (e.g., 23:01:01 at one minute one second after eleven o'clock in the evening). Not typically used for reporting.

Unlike MD_Date_Dateinteger (in MD_Date), this integer is not really human-readable, because it's not set up for base-10. Rather, it's calculated using the formula: (hour << 16) Or (min << 8) Or (sec), where the Or's are logical, and the << operator is a binary left shift. In T-SQL, this is (hour * POWER(2, 16)) + (minute * POWER(2, 8)) + second.

 

MD_Unit_SurrogateKey

numeric

 

 

MD_ThingM_SurrogateKey

numeric

 

 

MD_Source_SurrogateKey

numeric

 

 

MD_Vend_SurrogateKey

numeric

 

 

MD_Building_SurrogateKey

numeric

 

 

MD_Room_SurrogateKey

numeric

 

 

MD_MQual_SurrogateKey

numeric

 

 

MF_ReadHourAcc_Value

double precision

Summable value for a given hour (like 'Total kilowatt hours produced' or 'Total seconds available').

 

MF_ReadHourAcc_Coverage

int

Number of seconds covered for a given data point. Since the grain of this table is per hour, and the unit here is seconds, this defaults to 3600.

 

VMF_ReadHourAcc_Seconds

 

If unit is seconds, then the value (MF_ReadHourAcc_Value) will be repeated here.

 

VMF_ReadHourAcc_ValueInBtus

 

MF_ReadHourAcc_Value converted to BTUs, for units that can be converted to BTUs.

 

VMF_READHOURACC_BTUSPERSQFT

 

This value can't be aggregated using SUM() unless you're planning on dividing SUM() by a count and creating an average.