Skip to main content
Solved

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


benvk
Contributor
Forum|alt.badge.img+7
  • Contributor

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.

View original
Did this help you find an answer to your question?

6 replies

takashi
Influencer
  • 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+7
  • Author
  • Contributor
  • April 6, 2020
markatsafe wrote:

@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+9

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+8
  • 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!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings