Flatten
Converts the columns of a table into the attributes of a frame.
This deletes the table.
Parameters
Name | Default | Meaning |
---|---|---|
method | A method name | |
columns | An array of column names (used only for stable and stablenz) | |
tolerance | An array of floating-point tolerance levels (used only for stable and stablenz) | |
samples | 2 | The number of samples a value must be stable for |
Methods
The following methods are supported…
First: Uses the first record found in the table. Last: Uses the last record found in the table. Mid: Uses the midpoint record of the table. Stable: Uses the first value once key indicators have stablised. Stablenz: As above, but the indicators must also be non-zero. Avg: Uses the average value of all of the rows in the table.
Description
This layer is normally used to capture the activity of equipment at specific times or across periods of time.
Stability Testing
When using 'stable' or 'stablenz' as the method, only those columns that have been specifically named will be checked for stability.
You can adjust what is considered 'stable' using the 'tolerance' property. This is how much the value is allowed to change sample-to-sample in order to be considered 'different'.
By default, the layer will wait to see two samples with no changes. You can extend this further.
Example
If the frame contains the following table of data…
Attribute | Value |
---|---|
StartTime | 09:00AM |
EndTime | 10:00AM |
Time | Machine.Speed | Machine.Voltage | Machine.Current |
---|---|---|---|
09:00AM | 0 | 0 | 0 |
09:10AM | 0 | 240 | 3.2 |
09:20AM | 15 | 240 | 1.5 |
09:30AM | 18 | 240 | 1.5 |
09:30AM | 17 | 240 | 1.5 |
09:30AM | 17.5 | 240 | 1.5 |
{ "type": "flatten", "method": "first" }
The final results will add 'Machine.Speed' at 0, 'Machine.Voltage' as 0 and 'Machine.Current' as 0.
{ "type": "flatten", "method": "last" }
The final results will add 'Machine.Speed' at 17.5, 'Machine.Voltage' as 240 and 'Machine.Current' as 1.5.
{ "type": "flatten", "method": "stablenz", "columns": ["Machine.Voltage","Machine.Current"], "tolerance": [1,0.2], "samples": 2 }
The final results will add 'Machine.Speed' at 18, 'Machine.Voltage' as 240 and 'Machine.Current' as 1.5.