views:

974

answers:

1

I have a data set (~10000 rows) with the following form:

+---------------------------+---------------+-------------+
| DateTimeCreated           | Machine       | ProductName |
+---------------------------+---------------+-------------+
| 2009-03-03 00:00:12.217   | COMP001       | Product001  |
+---------------------------+---------------+-------------+

I have graphed this using a pivot table and chart with the following layout

Page: ProductName
Column:  Machine
Row: DateTimeCreated - Group by Day, Hour, Minute
Data: Count of DateTimeCreated

This all works correctly however the timescale of the resulting graph is not linear. For those minutes of the day where the event I am tracking did not occur these minutes do not show on the graph. The event I'm tracking also can go hours without occurring which results in an even more non-linear graph.

Here is an attempt to illustrate the x-axis of my graph:

|09|   10    |  11  |         12         |14| 16 |      18        |  20  |23|

The desired result is:

|00|01|02|03|04|05|06|07|08|etc

So each hour is the same size and is shown even if the event did not occurr (so on my Line graph the line simply goes to 0 for a while)

Can this be achieved?

+1  A: 

I changed my data set to look like this

+---------------------------+---------------+-------------+-------+
| DateTimeCreated           | Machine       | ProductName | Count |
+---------------------------+---------------+-------------+-------+
| 2009-03-03 00:02:00.000   | COMP001       | Product001  |   2   |
+---------------------------+---------------+-------------+-------+

so that the query is grouping the events by minute and providing the count in the minute

I then generated a second data set that contained an entry for every minute of the day but with a count of 0 As I was only working with 24hr data sets this was not unreasonable

Combining the two data sets gives a linear timeline on the pivot chart.

Al Nixon