Skip to main content
Solved

Creating a custom totalizer using formulas and aggregations?

  • May 13, 2025
  • 2 replies
  • 157 views

We are investigating if there is a way to create a tag that would sum the totalizer and/or flow indicator? I have read through this article but not exactly the answer I am looking for: 

https://community.trendminer.com/functional%2Dtips%2Dtricks%2D48/optimizing%2Ddaily%2Dproduction%2Dtracking%2Dfour%2Dmethods%2Dfor%2Daccurate%2Dmonitoring%2D351

Best answer by fvandael

Hi,

Great question! Depending on your specific needs, TrendMiner offers several options to perform aggregations over time:

1. Custom Calculations (Python-Based Tags)

For advanced aggregations like totalizers or block aggregates over extended periods, TrendMiner's Custom Calculations feature is ideal. This allows you to define new tags using Python scripts, enabling complex computations tailored to your requirements. You can access this feature through the Tag Builder. For detailed guidance, refer to the Custom Calculations User Guide.

2. Calculations on Search Results

If you want to perform aggregations on specific time periods identified through searches, TrendMiner provides a way to calculate metrics like integrals over these periods:

  • Perform a Search: Identify the time frames you're interested in by conducting a search. TrendMiner offers built-in time tags like TM_hour, TM_day, TM_month, and TM_year to facilitate time-based aggregations. These tags remain constant during their respective time intervals, so if you want to calculate totalizers per hour, day, or month, you can search for periods where these tags are constant to isolate the relevant time windows.

  • Apply Calculations: Once you have your search results, you can apply calculations such as integrals to these periods. This is particularly useful for quantifying total values over time. Detailed instructions are available in the Calculations on Search Results guide.

  • Write to Context Items: After performing the calculations, you can write the results to context items for documentation or further analysis. This process is outlined in the Working with the Search Result List guide.

If you need further assistance or have specific scenarios in mind, feel free to ask!

 

2 replies

Forum|alt.badge.img
  • Employee
  • 26 replies
  • Answer
  • May 14, 2025

Hi,

Great question! Depending on your specific needs, TrendMiner offers several options to perform aggregations over time:

1. Custom Calculations (Python-Based Tags)

For advanced aggregations like totalizers or block aggregates over extended periods, TrendMiner's Custom Calculations feature is ideal. This allows you to define new tags using Python scripts, enabling complex computations tailored to your requirements. You can access this feature through the Tag Builder. For detailed guidance, refer to the Custom Calculations User Guide.

2. Calculations on Search Results

If you want to perform aggregations on specific time periods identified through searches, TrendMiner provides a way to calculate metrics like integrals over these periods:

  • Perform a Search: Identify the time frames you're interested in by conducting a search. TrendMiner offers built-in time tags like TM_hour, TM_day, TM_month, and TM_year to facilitate time-based aggregations. These tags remain constant during their respective time intervals, so if you want to calculate totalizers per hour, day, or month, you can search for periods where these tags are constant to isolate the relevant time windows.

  • Apply Calculations: Once you have your search results, you can apply calculations such as integrals to these periods. This is particularly useful for quantifying total values over time. Detailed instructions are available in the Calculations on Search Results guide.

  • Write to Context Items: After performing the calculations, you can write the results to context items for documentation or further analysis. This process is outlined in the Working with the Search Result List guide.

If you need further assistance or have specific scenarios in mind, feel free to ask!

 


yracette
Pioneer
Forum|alt.badge.img+1
  • 12 replies
  • November 12, 2025

We have a definite need for totalizers. In the oil and gas industry we have production runs that can extend for years after a new catalyst has been loaded on a unit. Totalizing charge or impurities on the catalyst since the start of run to today with a daily update is crucial

1- Custom calculations: we will be exploring this option. Hopefully, this allows not only exposing the custom calculation for use with Formula Builder but also offer the possibility of passing arguments in a similar was a the built-in convert function that allows 3 arguments

2- Calculations on search results are great and can be used with Event Analytics but can unfortunately not be saved as tags which would be very useful for trend plotting or adding to dashboards