Skip to main content
Solved

Is there a simple way to add a 'total' row to a Excel Writer?

  • April 3, 2020
  • 6 replies
  • 169 views

benvk
Contributor
Forum|alt.badge.img+8

I am outputting many rows to an excel table, some of my columns are numeric, I am hoping to add a total row at the bottom of my table, to sum these columns. I have found the Statistics Calculator, but I have no idea how to apply it (if at all possible).

 

Any thoughts?

Best answer by markatsafe

@benvk For FME 2020 we revamped the StatisticsCalculator to make it faster and easier to use. So that is now a good alternative to the Aggregator.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

takashi
Celebrity
  • April 3, 2020

Hi @benvk, I would use the Aggregator with the Attributes to Sum option to do that. See the screenshot below. Assuming attr1, attr2, attr3 has numeric values.


Forum|alt.badge.img+2
  • Best Answer
  • April 3, 2020

@benvk For FME 2020 we revamped the StatisticsCalculator to make it faster and easier to use. So that is now a good alternative to the Aggregator.


gazza
Contributor
Forum|alt.badge.img+6
  • Contributor
  • April 3, 2020

Another option is to let Excel do the work by writing a SUM formula after your data. I've written a blog post about how to do this here.

To make this dynamic I like to use this formula:

=SUM(INDIRECT(ADDRESS(1,COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))

or if there is a header sell then

=SUM(INDIRECT(ADDRESS(2,COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))

 


benvk
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • April 6, 2020

@benvk For FME 2020 we revamped the StatisticsCalculator to make it faster and easier to use. So that is now a good alternative to the Aggregator.

I can see the results in the statistics calculator, they look correct. I still am perplexed how to get FME to insert a row in the sheet to show these totals?


fme_can_do_it
Enthusiast
Forum|alt.badge.img+12
  • Enthusiast
  • February 25, 2025

Hi ​@benvk were you able to insert the row into your Excel report? I am trying to do the same thing, specifically inserting a row that calculates the difference between the values in a column. Thank you!


saraatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • February 28, 2025

Hi ​@fme_can_do_it, I’d suggest trying out the AttributePivoter to create a totals column. The example in the transformer’s documentation serves as a good starting point for this. I hope this helps!