Column summary to row summary

Tags: #<Tag:0x00007f2492f89158>

Can I change the column summary to row summary like the picture below?
By the way, I don’t want to use formulas.


Hi @curlydoggi

row summary is not yet implemented. And if you do not want to use formulas, you can also use native JS (Math, reduce()) using the getDataAtRow() method.

The destination option solved showing the results of the col summary in the last column on the right. However, there is no source row option, so it cannot be made like the picture above.

You told me to use native JS (Math, redox()) using getDataAtRow() method, but I don’t know exactly what it means. Can I ask for a demo?

f you do not want to use predefined formulas (from our plugin) then you would need to use native JS options, like reduce().

Here are some related topics

  1. How to sum values
  2. Average is just the one above with the division to whatever you received should look like value_from sum / number_of_elements and numer_of_elements can be checked via hot.countCols() - this method gives you a number of columns in the table
  3. Max - can be checked via Math.max
  4. Mix - can be checked via Math.min
  5. Count - here you’d need to create a bit more logic if you’d want to skip formulas but still have the same logic as

And here’s a demo I made some time ago, it should help you to specify how to use those functions

Thank you so much for posting the demo
I am writing code while checking your demo, but I applied it and wrote my own sum of row code, is there a way to know which is better in performance when comparing your code with mine?

For example, when we talk about performance when the amount of cells increased or the number of rows in the table increased

I do not think that we have tests for that as it is not a part of any plugin or core method :slight_smile: You can try to create a huge array and populate the reduce in the total column to check how it would work.