Is it possible to find the sum of items based on their position in tinydb?

Is it possible to find the sum of items based on thier position in tinydb?
If yes, please let me know how it is done.

I am looking for something like the following.

(DATA are tinydb tags and list is the value)

DATA1[10,20,30]
DATA2[10,20,30]
DATA4[10,20,30]
DATA5[10,20,30]

Sum for index 1 = 40
Sum for index 2 = 80
Sum for index 3 = 120

it is possible, but cumbersome…
you have to get all the tags and use a for each in list loop to add each column of the lists
it would be much easier to use the sqlite database, which offers more functionality
https://docs.kodular.io/components/storage/sqlite/

this could be your select statement
SELECT sum(column1), sum(column2), sum(column3) FROM myTable

Taifun

4 Likes