ValueSummary

Captures key values from a table into the frame.

Parameters

NameDefaultMeaning
methodavgavg, max, min or total
columnsRestrict the summary to only specific columns
prefixText to add before the name of each value
suffixText to add after the name of each value
namedOverride the name for the Captured attribute
whereA condition that must be met for the value to be analysed
splitBreak the summaries up based on a value

Special Rate Parameters

rateThe value is a rate, controlled by a column value
timebaseThe number of seconds per time unit

Description

This function performs simple analytic functions on some (or all) of the columns in a table and captures them.

This can be used to capture min, max, avg or total values across the different columns of your tables.

If you don't specify which columns the analytic should be performed on, it will be applied to all columns.

Example

If the frame contains the following table…

TimeSpeedTemperature
10:000100
10:1025100
10:2050100
10:3075100
10:40100100
{
   "type": "valuesummary",
    "method": "avg"
}

Your frame would then contain…

NameValue
Average Speed50
Average Temperature100

Working with Rates

If your values represent a rate (such as an amount of production per minute), you can use the two special parameters ('rate' and 'timebase') to change how the analytics are performed.

The first is rate, which should be the name of the column where the speed or flow rate of your process can be read.

The next is timebase, which lets specify the number of seconds that each 'rate' measurement represents. For example, this would be '60' if your rate measurement is in units-per-minute, or 3600 if it's in units-per-hour.

So - for example - if you have scale giving you weight per meter and a sensor giving you meters per minute, you could use the following configuration…

{
   "type": "valuesummary",
   "columns": ["Scale.Weight"],
   "rate": "Line.Speed",
   "multiplier": 60,
   "mode": "total"
}

…which would give you a “Total Scale.Weight” figure that contained the total weight of manufactured product.

If you simply want a total of the rate (ie, you wanted a total of the number of meters of production), use the name in both the column and the rate properties. For example…

{
   "type": "valuesummary",
   "columns": ["Line.Speed"],
   "rate": "Line.Speed",
   "multiplier": 60,
   "mode": "total"
}

Splitting Results

In some cases, you might want several different summary values.

TimeSpeedProduct
10:000Chocolate
10:1025Strawberry
10:2050Blueberry
10:3075Caramel
10:40100Bananna
{
   "type": "valuesummary",
    "method": "avg",
   "split": "Product"
}

Your frame would then contain…

NameValue
Average Chocolate Speed0
Average Strawberry Speed25
Average Blueberry Speed50
Average Caramel Speed75
Average Bananna Speed100

Naming

This layer gives you control of the attributes written to the Capture.

Without a 'named' parameter, your full value name will be…

<prefix><split><name><suffix>, where the name is made up of <function><column-name>

With the example data below…

TemperatureMode
10Stopped
20Running

…asking for an average temperature and using no other parameters would give you AvgTemperature with a value of 15.

Where specifying…

AttributeValue
prefixAverage
splitbyMode
named Temperature
suffix C

…would give you both Average Stopped Temperature C and Average Running Temperature C, with values of 10 and 20 respectively.