Summing fields

Options
Hello Xano community!

Is there any way to sum all fields in a column and add the result in a field from another column?
Thank you!

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     You can do this, but even more productive is to just leave the "raw" fields in the table, and save the calculation or creation of the "additional column" for when the user asks for it, e.g. the API endpoint. So you have columns A B C that contain values 3,4,5. Instead of creating an additional column "sum" in the table that you need to keep in synch (in this case, a value of 12), you make a field "sum" on the API endpoint. That way anyone looking at it has easy access to the calculated field without the performance or synchronization challenge of the additional table complexity.