Average on table's column values?

Hi, I ran into a problem and I can't find the solution to it anywhere.

So, I'm trying to get the average of my table's column values. So far, I've done it in the following way:

Change Attribute "average" to (tableCellValue( game.My_table ,1,1)+tableCellValue( game.My_Table ,2,1)+tableCellValue( game.My_Table ,3,1))/3

In this example I have three rows so it's easy to write the "code", but my concern is that I would like to have 10-20 rows so is there any simplier way to do this? And if not, can the Gamesalad handle that kind of long code without performance issues?

Thanks in advance! :)

Comments

  • machetemachete Member Posts: 8
    A little bump if someone could help it would be greatly appreciated. I guess there isn't better solution...
  • ShmirlyWhirlShmirlyWhirl Member Posts: 189
    There most certainly is an easier way. Do you have any experience with writing code? It would be a lot easier for me to say "treat it like a loop" then to have to type out a long winded explanation.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    A timeStamp loop is probably the easiest to get started with and it will make quick work of 20 columns.

    https://forums.gamesalad.com/discussion/comment/381275/#Comment_381275
Sign In or Register to comment.