Hello,
We are looking into adding an aggregation type which would calculate a weighted average based on another column's weight values, instead of calculating a straight average as is currently supported by Flexmonster. I am attaching a screenshot of a table which shows what I'm referring to. i.e. A would be a sum of A1 and A2 weighted by their corresponding values in the Weights column, divided by the total weight.
So the calculation for A would be (1000 * 0.3 + 2000 * 0.6)/0.9 = 1,666.67.
Is there a way of doing that currently? If so, could you give us some pointers on how to achieve it? If not, could Flexmonster implement it? Thank you.
Hello, Will!
Thank you for writing to us.
Such a formula can be created with Flexmonster's calculated values - a feature for creating custom formulas based on existing measures. Assuming that your dataset contains individual fields with values, weights, and string hierarchies for "A" and "B", you can create a formula as is shown in this example: https://jsfiddle.net/flexmonster/0tw5f3xh/
Here is an explanation of this example:
"value_x_weight"
- values multiplied by weights. For correct output, this formula should multiply values individually, which can be flagged with individual: true
. Also, since this is a part of the final formula, so it should be hidden with the active: false
parameter."weighted_avg"
- the formula used for final visualization, which divides the "value_x_weight"
on the sum of weights.We are looking forward to hearing your feedback.
Best Regards,
Maksym
Hi Maksym,
Thank you for your quick response.
Following up to your response, is there a way to hide the value field so that the user doesn't have the option of displaying it at all? Also, is there a way to display some of the values that are under Calculated Values directly in the list, in the same way that other values such as name, type and weight are being displayed?
Best,
Will
Hello, Will!
Thank you for your reply.
Both mentioned customizations can be implemented within Flexmonster. The "value" field can be hidden from the Fields List via CSS:
#pivot-container .fm-fields-view .fm-ui-list > [aria-label="value"] {
display: none;
}
Since all fields within the Field List use the "aria-label"
attribute, this approach can be universally applicable for hiding any field independently from its position. To show calculated values on top of the Fields List and not in a folder, you can change the "Calculated values" folder name localization to an empty string.
Our team prepared a JSFiddle to illustrate both removing the "value" field and the "Calculated values" folder: https://jsfiddle.net/flexmonster/j63pr7xL/
Please let us know if these solutions work for you.
Best Regards,
Maksym
Hello, Will!
Hope you are doing well.
Please let us know if you had time to test the suggested configurations for modifying the visualization of values in the Fields List.
Looking forward to hearing your feedback.
Best Regards,
Maksym
Hello, Will!
Just checking in to ask if you have tried the provided approach for modifying the Fields List.
Please let us know if it works for you.
Best Regards,
Maksym