Usage
You can query time-series data in Excel using custom functions provided by the Excel Add-in. After setting up a connection in the configuration screen, these functions work just like Excel’s built-in ones.
When you type =, a dropdown shows all available functions. Those starting with FACTRY come from the Add-in. Below, we demonstrate two of these functions.
You can find details about all functions in the help section, accessible through the task pane’s help button. Have a look at the reference documentationreference documentation for a complete overview of all available functions.
Example for getting a single value of a measurement
- Select any cell in the worksheet and type in the following formula: =FACTRY.GET_VAL("historian";"plant1";"MACHINE1/TEMPERATURE"; NOW();"1h").
- Replace “historian” with the name of the connection you have configured here
- Replace “plant1” with the name of the time series database of the measurement.
- Replace “MACHINE1/TEMPERATURE” with the name of the measurement you wish to query.
- Replace NOW() with the specific timestamp to query or keep it to get the most recent value.
- Replace “1h” with the maximum age that the value may have.
- Pressing enter will display the resulting value in the selected cell.
Example for getting multiple raw values
- Select any cell in the worksheet and type in the following formula: =FACTRY.GET_RAW_DATA("historian";"plant1";{"CALC_CONST_BOOL";"CALC_CONST_NUMBER"};NOW()-1;NOW()-1;10)
- Replace “historian” with the name of the connection you have configured here
- Replace “plant1” with the name of the time series database of the measurement.
- Replace {“CALC_CONST_BOOL”;“CALC_CONST_NUMBER”} with an array of the measurements you wish to query. You can also use a single measurement.
- Replace NOW()-1 with the start time and NOW() with the end time.
- Replace 10 with the maximum number of values you want returned.
- Pressing enter will display the resulting value in the cells below the formula.