How to implement dynamic "Ratio of Totals" calculation in Freedom UI Dashboards (Filtering Issue)
Current Setup:
I am working in Freedom UI. Currently, I have a KPI called "Margin per Liter (Excl. VAT)". It is calculated via a Business Process that:
- Sums up the "Margin without VAT" for all orders.
- Sums up the "Quantity (Liters)" for all orders.
- Divides the first sum by the second.
- The Problem: The result is saved into a specific field within a single "dummy" Order record.
The Issue:
Since the value is pre-calculated and stored statically in a record, the Dashboard indicator does not react to Quick Filters (Period, Owner, etc.). It always shows the same total regardless of the filters applied on the page.
Goal:
I need the dashboard to calculate this ratio dynamically: $\sum(\text{Margin}) / \sum(\text{Liters})$. It must recalculate every time a user changes the filter (e.g., to see the margin per liter for a specific manager or last month).
Questions:
- How can I set up a "Ratio of Sums" in Freedom UI without using a background Business Process?
- Is there a way to use the "Formula" source in the Indicator widget to divide two different aggregated sums while maintaining filter context?
- What is the best practice for such "weighted average" metrics in Freedom UI to keep them responsive to page filters?
Like
Greetings,
Thank you for your question.
We would like to inform you that, in order to achieve your goal, you may use the new beta feature 8.3.3 – Custom Metric Formulas.
To take advantage of this functionality, please add and enable the additional feature EnableFormulaAggregationInDesigner, which is not registered and is disabled by default. You can find more details in the documentation: Implement a custom additional feature.
Once this feature is enabled, you will have an additional option within the dashboard metric configuration to define the custom formula as described.
Additionally, the metric will be automatically linked to the section where it is created. As a result, when filters are applied within that section, the metric values will dynamically update accordingly.
For your reference, please see the implemented example for the “Case” section:
If you have any further questions, please respond to this email we would be happy to help.
Have a nice day!
Greetings,
Thank you for your question.
We would like to inform you that, in order to achieve your goal, you may use the new beta feature 8.3.3 – Custom Metric Formulas.
To take advantage of this functionality, please add and enable the additional feature EnableFormulaAggregationInDesigner, which is not registered and is disabled by default. You can find more details in the documentation: Implement a custom additional feature.
Once this feature is enabled, you will have an additional option within the dashboard metric configuration to define the custom formula as described.
Additionally, the metric will be automatically linked to the section where it is created. As a result, when filters are applied within that section, the metric values will dynamically update accordingly.
For your reference, please see the implemented example for the “Case” section:
If you have any further questions, please respond to this email we would be happy to help.
Have a nice day!
Thank you very much for your answer, the information is very useful, I will definitely try to implement this.
Have a great day!!