I am definitely a novice when it comes to FactorySQL so let me explain the situation first.
We have been inserting information from a device into the database every 30 seconds. The fields that are inserted are:
ndx (auto generated index)
t_stamp (timestamp)
step (the step the device is on usually 0-40 and then starts over)
measuredValue1 (some value from the device)
Here is some sample data:
Ndx t_stamp step measuredValue1
1 9:00:00 1 10.2
2 9:00:30 1 10.1
3 9:01:00 1 10.2
4 9:01:30 2 5.0
5 9:02:00 2 5.0
6 9:02:30 3 5.0
7 9:03:00 1 10.0
8 9:03:30 1 10.2
9 9:04:00 2 5.0
10 9:04:30 3 5.0
The goal here is to be able to average the measured value for the first time step 1 happened and the second time and so on as the step gets ran in each cycle. We can then take the average of the measured value for each time the step is run and graph it for analysis and compare the average to make sure the step is staying consistent.
I need to be able to extract the information out by step. If I try to group by step all of the rows of the same step get grouped together. I need to group the rows of steps together by when the step was ran, but have no idea when the step gets started and stopped. I was thinking maybe an action item could be created that would assign the same unique identifier to the group of rows with the same step number and then increment the unique identifier every time the step number changes. Any ideas would be great.