Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Fact table design for building monitoring application Expand / Collapse
Posted Wednesday, August 1, 2012 6:46 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 14, 2013 6:39 PM
Points: 1, Visits: 36
I am monitoring the performance of several buildings across the country. Each building contains a datalogger that records hourly data from a variety of sensors. Although 50-100 measurements of 10-15 different types are actually being made in each building, let's assume that the same 6 measurements are made in each building and that the only measurement types are volume, electrical energy, temperature, and pressure. Just to be clear, the "1 hour" volume and electrical energy measurements represent the total volume/energy "flow" over the past hour. On the other hand, the "1 hour" temperature and pressure measurements represent the average temp/pressure over the past hour.

To summarize, let's assume the following 6 "measures" are being recorded every hour in each building:
1) total cold water volume (liters) through a pipe over the past hour
2) total air volume (liters) through a duct over the past hour
3) total electrical energy consumed (watt hours) by the lighting circuit over the past hour
4) total electrical energy consumed (watt hours) by the appliance circuit over the past hour
5) average basement temperature (Celcius) over the past hour
6) average A/C duct pressure (pascals) over the past hour

I'm trying to bring all the data from all the buildings together in a SQL Server relational data warehouse and a SSAS OLAP database for further analysis in Excel and SSRS. However, I'm having difficulty identifying the proper grain and therefore, the proper fact table design. I've tried to draw analogies to financials since all book examples are given in terms of financials, but that seems to have confused me further. While the temperature and pressure examples seem to be period snapshots, it isn't clear to me whether the energy and flow examples are transactions, periodic snapshot, accumulating snapshots, or something else.

Here are some design options that I've explored, although each seems to have its own apparent pitfalls:

Option 1: Create one fact table that includes all measurements that CAN be summed [e.g., volume (liters) and energy (watt hours)] and a second fact table for all measurements that CANNOT be summed [e.g., temperature (Celcius) and pressure (pascals)].
Option 2: Create a different fact table for each distince unit of measure. In other words, one fact table for volume, a second for energy, a third for temperature, and a fourth for pressure.
Option 3: Create a single fact table that includes all measurements of all units, whether or not they can be summed.
Option 4: Before creating the fact table, convert all measurements that can be summed to units that cannot be summed. For example, if the measurement frequency is one hour, convert volume to liters per hour and convert energy to watt hours per hour (or watts).

I'd very much appreciate someone's advice or suggestions. Thank you.
Post #1338909
Posted Wednesday, August 1, 2012 8:59 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, November 25, 2016 10:59 AM
Points: 366, Visits: 997
Wow, where to start. Before getting into the specifics of the table design, lets talk about monitoring in general. I highly recommend you check out some of the webcasts from the Groundwork folks. I know this is a RedGate sponsired forum but Groundwork recently did a webcast on the pitfalls to avoid when monitoring environments large and small. Specifically these: 1 2

One thing that jumps out at me is you've defined measures (liters of water per hour, for example) but no metrics. How many is too much? Too little? What is the dependency? For instance, what if the sensor fails? How do you stop your solution from spewing useless alerts when the sensor dies or the connection is down?

Before you start gathering facts and storing them in a table, answer those questions and watch the videos. That will make your tables come easier.
Post #1338923
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse