We have updated Flexmonster Software License Agreement, effective as of September 30, 2025 (list of changes)

Issue calculating ratios with customer totals across multiple buildings

Answered
Marc Henales asked on September 25, 2025

Hi,

We are experiencing an issue when calculating ratios on our page. Our DataFrame contains multiple buildings and multiple articles, with their relative values. The challenge is that each building has its own number of customers.

For ratio calculations, it is useful to sum all the customer counts for a specific article. However, when calculating the Grand Totals, we only need to sum the maximum number of customers per building once, instead of summing them multiple times.

 

Example data:

{

  "id_building": 34,

  "id_article": 4002,

  "num_customers": 20.120,

  "total_price": 4.146.254

},

{

  "id_building": 32,

  "id_article": 4002,

  "num_customers": 5.120,

  "total_price": 1.146.254

},

{

  "id_building": 34,

  "id_article": 3202,

  "num_customers": 20.120,

  "total_price": 800.000

},

{

  "id_building": 32,

  "id_article": 3202,

  "num_customers": 5.120,

  "total_price": 300.000

}

Expected output (per article):

Row:

  4002

     -> 34    4.146.254     20.120     4.146.254/20.120

     -> 32    1.146.254      5.120     1.146.254/5.120

 

  3202

     -> 34       800.000    20.120     800.000/20.120

     -> 32       300.000     5.120     300.000/5.120

Expected Grand Totals:

                  6.392.508    25.240    6.392.508/25.240

 

So essentially, for the Grand Totals, we need the sum of all prices, but the number of customers should be calculated as the maximum per building (so they are not double-counted).

I reviewed the documentation but could not find anything about this specific case.

Thanks in advance for your help!

 

1 answer

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster September 29, 2025

Hello, Marc!

Thank you for reaching out to us.

Kindly note that in Flexmonster, the aggregation for totals and grand totals is the same as for the regular cells by design. To have separate aggregation for Grand totals is a popular feature request that has already been added to our Customers' Wishlist. We will notify you if there are any updates on the matter.

Feel free to reach out to us in case of any other questions.

Kind regards,
Solomiia

Please login or Register to Submit Answer