How to calculate sum of only a couple of values and percentage of the total amount

Answered
Takafumi asked on April 9, 2024

Is it possible to calculate as below?
|     | Country                                  | Total|
|.    | North America (=USA&Canada)| % of Total|
|     | 1337.00                                   |85.2% |
 

2 answers

Public
Maksym Diachenko Maksym Diachenko Flexmonster April 9, 2024

Hello, Takafumi!

Thank you for reaching out to us.

The described calculations can be performed in Flexmonster. For your convenience, we have logically divided our reply into separate blocks.

Grouping the "Country" hierarchy by region
Please note that Flexmonster supports grouping fields using other hierarchies in the dataset. We recommend adding the "Region" field to your dataset to match the expected outcome. After this, you can combine the "Region" and "Country" fields into a multilevel hierarchy. The multilevel hierarchy will initially display its highest level with an opportunity to expand its children.

Displaying values as percents
To show the percentages, you can use the "percent" aggregation, which would replace the values with percentages from a total. However, please note that the resulting values will be shown with unlimited decimal places. This behavior can be changed by configuring a number formatting. To round the value and limit the number of digits after the decimal point, define the decimalPlaces formatting option.

Our team prepared a sample combining these approaches to achieve a layout similar to your requirements: https://jsfiddle.net/flexmonster/4b59q72r/ 
Feel free to contact us if further assistance is needed.

Best Regards,
Maksym

Public
Maksym Diachenko Maksym Diachenko Flexmonster April 24, 2024

Hello, Takafumi!

Hope you are doing well.
We are wondering if the suggested approaches for grouping the hierarchies and percentage formatting worked for you.
Looking forward to hearing your feedback.

Best Regards,
Maksym

Please login or Register to Submit Answer