Calculated Field Master

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Action Edition > Action Reference > Summary Action (Logging/Counting/Daily Report) > Summary Action Configuration File and Folder Structure >

Calculated Field Master

Defining Calculated Field Master

By defining a calculated field master (fieldmaster_calculation.csv), calculations can be performed between the aggregated data of each field, and the calculation results can be included in the aggregated data and saved. The path to the calculated field master is specified in the CalculationFieldMaster property in the root log section of the summary master. If you do not use this function, there is no need to define a calculated field master.

 

A calculated field master consists of one line per calculation formula. The first line of a calculated field master is a header line, which defines which parameters are entered in which columns. Then, from the second line onwards, the type of calculation to be performed is defined line by line.

Below is an example of a calculated field master setting.

 

Calculated Field Master (Example)

[Name],

[Comment],

[Expression],

[UncertainIsZero],

[TermOfValidity],

[DecimalNum1],

[SummaryType1]

C000,

Calculation tag 1,

T000 + T001 + T002,

F,

,

2,

AVERAGE

C001,

Calculation tag 2,

T003 + T004 / 2,

F,

,

2,

AVERAGE

C002,

Calculation tag 3,

C000 + C001,

F,

,

2,

AVERAGE

 

 

Header Name

explanation

[Name] (Required)

Field name. The name used when referencing from summary reports, historical trend graphs, etc. Set a name that does not overlap.

[Expression] (required)

Create an expression using the field name ([Name]). Field names defined in the tag field master and calculation field master can be used in the expression. The operators and functions that can be used in the expression are based on "Calculation Expression Syntax".

 

Example: General operators

(T000 + T001) / 100

 

Example) Find maximum value from the fields T000/T001/T002

Math.Summary("max", T000, T001, T002)

*In addition to "max", "min", "ave", and "sum" are also supported.

* Any function that can be used in the formula syntax can be used within the formula.

 

Please note that when using field names defined in the Calculation Field Master in an arithmetic expression, the calculations are processed in the order defined in the Calculation Field Master file.

In the example below, define CAL01, CAL02, and then define CAL03.

 

[Name],        [Expression]

CAL01,        T000 + T001

CAL02,        T002 + T003

CAL03,        CAL01 + CAL02 + T004

 

[Comment]

You can include any comments.

 

[UncertainIsZero]

This is a setting for how to handle undefined values during calculation. If you specify "F" (or n) for [UncertainIsZero], the calculation result will also be undefined if the formula contains an undefined value. For example, in the formula "T000 + T001", if the value of T001 is missing due to poor communication, the calculation result will also be undefined (missing value). If you specify "T" (or y) for [UncertainIsZero], the calculation will treat undefined values as the numeric value 0. The [UncertainIsZero] column is not required. If omitted, the default value will be "F".

 

attention

The setting of this parameter affects the behavior of the quality check function. For details, see the notes for ExpressionQualityCheckType in this table.

 

[DecimalNum1] ~

[DecimalNum{n}]

Please refer to "Tag Field Master".

[SummaryType1] ~

[SummaryType{n}]

This specifies the aggregation method. If you only need to perform the calculation of the calculated field according to the formula defined in [Expression], you do not need to specify the aggregation method. However, if you want to perform further aggregation logging using the calculation result of [Expression] as the parent, specify the aggregation method in the [SummaryType] column.

Specifically, when aggregating raw data into daily reports, you may want to perform calculations according to the formula defined in [Expression], and when aggregating daily reports into monthly reports, you may want to use the results of the daily calculations to aggregate using the aggregation method specified in the [SummaryType] column (such as AVERAGE or TOTAL).

 

For information on the aggregation methods that can be specified, please refer to "Tag Field Master".

 

[SummaryParam1] ~

[SummaryParam{n}]

Please refer to "Tag Field Master".

[TermOfValidity]

Please refer to "Tag Field Master".

[ReportHeader1] ~

[ReportHeader{n}]

Please refer to "Tag Field Master".

[UserParam1] ~

[UserParamn}]

Please refer to "Tag Field Master".

[ExpressionQualityCheckType1] ~

[ExpressionQualityCheckType{n}]

In the ExpressionQualityCheckType column, you can specify the type of quality check when calculating according to the [Expression] expression. The ExpressionQualityCheckType column is defined by the column name specified in the ExpressionQualityCheckTypeFieldMaster parameter of the Summary Master. If you specify the type of quality check in the Calculated Field Master, the setting in the Calculated Field Master takes priority.

 

type

explanation

Empty text

It follows the value specified in ExpressionQualityCheckType of Summary Master.

NONE

No quality check.

NULLTONULL

If a NULL value exists in the calculation data, it is treated as a NULL value.

NULLTOBAD

If a NULL value is present in the calculation data, it is treated as an unreliable value (such as *123).

BADTONULL

If the calculation data contains unreliable values (such as *123), the value is treated as NULL.

BADTOBAD

If an unreliable value (such as *123) is present in the calculated data, it is treated as an unreliable value (such as *123).

 

attention

In the quality check of calculated fields, the setting of the [UncertainIsZero] column in the calculated field master takes precedence. If you specify "F" for UncertainIsZero, for example, even if you set NULLTOBAD above, the calculation result will be NULL if a NULL value exists.

 

Example: When NULL values exist in the calculation data

UncertainIsZero is F: NULL+123=NULL *It will be NULL regardless of ExpressionQualityCheckType.

UncertainIsZero is T and "NONE": NULL+123=123

UncertainIsZero is T and "NULLTONULL" : NULL+123=NULL

UncertainIsZero is T and "NULLTOBAD": NULL+123=*123

 

 

hint

For more information about the quality check function, see "Using the quality check function".

 

[QualityCheckType1] ~

[QualityCheckType{n}]

 

You can define the QualityCheckType column in the Calculated Field Master using the column name specified in the QualityCheckTypeFieldMaster parameter of the Summary Master.

This parameter specifies the type of quality check that will be performed when the summary is performed according to the summary method specified in the [SummaryType] column.

For example, if you want to perform calculations according to the formula defined in [Expression] when aggregating raw data into daily reports, and then use the calculation results of the daily reports to aggregate monthly reports using the aggregation method specified in the [SummaryType] column (such as AVERAGE or TOTAL), the quality check type of this parameter will be used when aggregating data using the [SummaryType] column.

 

Furthermore, if you define both "QualityCheckType" and "QualityCheckTypeFieldMaster" in the Summary Master, the calculated field master takes priority for the fields in the row where the quality check type is specified in the calculated field master. For the fields in the row where an empty string is specified for the quality check type, the QualityCheckType in the Summary Master is used.

 

type

explanation

Empty text

It follows the value specified in QualityCheckType of Summary Master.

NONE

No quality check.

NULLTONULL

If there is a NULL value in the source data, it will be treated as a NULL value.

NULLTOBAD

If NULL values exist in the source data, they are treated as unreliable values (such as *123).

BADTONULL

If the source data contains unreliable values (such as *123), the value will be set to NULL.

BADTOBAD

If unreliable values (such as *123) exist in the source data, they will be treated as unreliable values (such as *123).

 

hint

For details on the quality check function, please refer to "Using the quality check function". Note that the quality check judgment logic differs depending on the statistical method. For details, please refer to "Quality check of aggregation".

 

 

 

hint

When defining a calculated field, the following definition is required in the summary master.

 

1) Route Log Section

 

CalculationFieldMaster = Calculation field master file name

CalculationFieldIndex = Calculation field index file name

 

example)

[RAW]

CalculationFieldMaster=summary_fieldmaster_calculation.csv

CalculationFieldIndex=DB\summary_index_calculation.txt

...

 

2) Aggregation Log Section

 

CalculationType=Calculation method

 

Example 1) Calculate according to the [Expression] column of the calculation field master.

[RAW::DAY]

CalculationType =[Expression]

...

 

Example 2) Aggregate according to the [SummaryType1] column in the calculated field master.

[DAY::MONTH]

CalculationType =[SummaryType1]

...

 

 

hint

If you modify the calculated field master after starting operation, you will need to take FA-Server offline and then back online in order to apply the modifications.

 

 

hint

Calculations for calculated fields are performed at the time of aggregation processing such as daily aggregation. Calculations are not performed when logging the route log (raw data).