Skip to main content

❓What Are Custom Calculations?

Custom Calculations in TrendMiner empower advanced users to define new tags using Python scripts, enabling analytics and data transformations beyond what’s available through standard formulas or aggregations. This feature is powerful for creating custom KPIs or logic that’s specific to your plant or workflow.

 

🗂️️ Repo Structure Overview

The TrendMinerCS/custom-calculations repo is your go-to resource for getting started with Custom Calculations. It includes:

  • A Jupyter notebook with a detailed explanation of the workings of custom calculations and the TrendMiner sdk.

  • A detailed README outlining the possibilities with examples and screenshot.

  • Example Python scripts for common calculation scenarios.

  • Templates to help you quickly build your own scripts.

  • Clearly organized folders so you can browse by use-case or script type.

Browsing this repo is the fastest way to kickstart your own Custom Calculations and learn best practices directly from TrendMiner and the user community.

 

🛠️️ How to Build a Tag (using the Repo)

  1. Explore the repo’s templates and example scripts—pick one that matches your use-case.

  2. Copy the script into the TrendMiner Custom Calculations editor.

  3. Edit the script as needed (set dependencies, adjust logic, etc.).

  4. Use TrendMiner’s Preview to validate and test.

  5. Save and start using your new calculated tag in dashboards or monitors!

 

đź§© Essentials, Debugging, Best Practices & Licensing (Quick Guide)

  • Scripts must read environment variables for timestamps and output a CSV file with two columns: ts and value.

  • You can declare up to 50 dependency tags per script, and each script should execute within 2 minutes (for 1 month of data).

  • Add print statements for easy debugging—output is shown in the UI preview.

  • Access requires an Expert license. Reach out to your CSM or TrendMiner support to get started.

Explore the GitHub repo to find ready-to-use scripts, contribute your own, and connect with the growing community of TrendMiner power users. If you have a great example script that isn’t in the repo yet, we’d love to see it—feel free to submit a pull request or reach out to us directly to help the whole community by sharing your solution on GitHub!

Be the first to reply!

Reply