--- title: "Online Calculations" slug: "online-expressions" updated: 2025-07-16T14:07:34Z published: 2025-07-16T14:07:34Z canonical: "docs.bazefield.com/online-expressions" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.bazefield.com/llms.txt > Use this file to discover all available pages before exploring further. # Online Calculations ## Overview **Online Calculations** are a type of **Calculated Point** in Bazefield that continuously compute values in real time. Powered by the **Bazefield Calculation Service**, these calculations are triggered **every time their input value updates**, making them ideal for **live monitoring and dynamic KPIs**. --- ## Key Characteristics - **Real-Time Execution**: The calculation runs immediately whenever any input point changes. - **Always Up-to-Date**: Outputs reflect the most current state of the system. - **Recalculable**: Logic can be updated and recalculated at any time, over any time period. - **Long-Term Storage**: Results are saved to the **DataEngine Historian**, alongside other real-time telemetry. --- ## Example Use Cases ### ℹ️ Real-Time Assets Available A point named **AssetsAvailable** is configured for a Solar Farm model as follows: - **Point Type**: `CALCULATED_POINT` - **Script Type**: `Online_Calculation` - **Expression**: `Sum($[{{@}}-INV%-Available]:[0])` - **Data Template**: `HISTORIAN` (online data should be stored in the DataEngine archive files) This configuration uses substitution parameter `{{@}}` to retrieve the Solar Farm’s ObjectKey and wildcard `%` to retrieve all assets keyed “INV”. The resulting match is all “Available” points for inverters belonging to the site (e.g., SF1-INV001-Available, SF1-INV002-Available, etc.). The Inverter “Available” point is 0/1 based on if the inverter is in an available state or not. Therefore, this Online Calculation gives the **total number of available inverters for the solar farm in real time**. ![](https://cdn.document360.io/a0786c0f-b171-4b24-8860-c32eb7ef2738/Images/Documentation/image(223).png?sv=2026-02-06&spr=https&st=2026-11-06T20%3A39%3A51Z&se=2026-11-06T21%3A39%3A51Z&sr=c&sp=r&sig=WsU8lUUvJADcN%2F51JdyrDgQ7%2FZ0hOmAMIvrMxqpLtp4%3D) ### ℹ️ Total Check Meter Power A point named **ActivePowerMeter** is configured for a Solar Farm model as follows: - **Point Type**: `CALCULATED_POINT` - **Script Type**: `Online_Calculation` - **Expression**: `Sum($[{{@}}-{{getObjectAttribute(meterAssetPattern)}}-ActivePower]:[0])` - **Data Template**: `HISTORIAN` (online data should be stored in the DataEngine archive files) Like the example above, this configuration uses substitution parameter `{{@}}` to retrieve the Solar Farm’s ObjectKey, but it also incorporates substitution parameter that retrieves a user-defined site attribute called “meterAssetPattern". The resulting match is all “ActivePower” points for meters that match the “meterAssetPattern” attribute (e.g., for attribute `MTROCM?`, SF1-MTROCM1-ActivePower, SF1-MTROCM2-ActivePower, etc. would be matched). Therefore, this Online Calculation gives the **total check meter ActivePower, computing gross output** **for the solar farm in real time.** ![](https://cdn.document360.io/a0786c0f-b171-4b24-8860-c32eb7ef2738/Images/Documentation/image(225).png?sv=2026-02-06&spr=https&st=2026-11-06T20%3A39%3A51Z&se=2026-11-06T21%3A39%3A51Z&sr=c&sp=r&sig=WsU8lUUvJADcN%2F51JdyrDgQ7%2FZ0hOmAMIvrMxqpLtp4%3D) ### ℹ️ Live Breaker Open Detection A point named **FeederBreakersStatus** is configured for a Wind Farm model as follows: - **Point Type**: `CALCULATED_POINT` - **Script Type**: `Online_Calculation` - **Expression**: `SUM(TagLast(ExpandPointKeys(GetChildObjectKeys(310), "BreakerStatus"))) > 0` - **Data Template**: `HISTORIAN` (online data should be stored in the DataEngine archive files) This online calculation will do the following, in order from inner methods to outer methods: 1. `GetChildObjectKeys(310)`: Retrieve all ObjectKeys matching type 310 (Feeder Breaker) 2. `ExpandPointKeys(GetChildObjectKeys(310), “BreakerStatus”)`: Retrieve an array of child feeder breaker Tag names that match the Point name “BreakerStatus” 3. `TagLast(ExpandPointKeys(GetChildObjectKeys(310), "BreakerStatus"))`: Retrieve the latest tag values for the array of tags from the last step 4. `SUM(TagLast(ExpandPointKeys(GetChildObjectKeys(310), "BreakerStatus")))`: Sum the tag values retrieved in the last step 5. `SUM(TagLast(ExpandPointKeys(GetChildObjectKeys(310), "BreakerStatus"))) > 0`: Check if the sum of BreakerStatus tags is greater than zero. If so, output True, else output False. Since the BreakerStatus tag is a 0/1 denoting whether a given Feeder Breaker is closed/open, **this online calculation provides a real-time indicator if any of the site feeder breakers are open**. ![](https://cdn.document360.io/a0786c0f-b171-4b24-8860-c32eb7ef2738/Images/Documentation/image(228).png?sv=2026-02-06&spr=https&st=2026-11-06T20%3A39%3A51Z&se=2026-11-06T21%3A39%3A51Z&sr=c&sp=r&sig=WsU8lUUvJADcN%2F51JdyrDgQ7%2FZ0hOmAMIvrMxqpLtp4%3D) --- ## Key Benefits ✔️ **Immediate Feedback**: Perfect for dashboards, alarms, and operational decisions. ✔️ **High Responsiveness**: Reacts instantly to changing conditions. ✔️ **Integrated Storage**: Seamlessly historized with other real-time data. ✔️ **Flexible Logic**: Supports arithmetic, conditionals, and multi-point references. --- ## When to Use Online Calculations Use Online Calculations when: - You need **real-time visibility** into asset behavior. - The output must **update immediately** with input changes. - You are powering **live dashboards** **or** **alerts**.