Sum of tinydb data for a tag

Hello friends,

Can anyone help?

I’m saving data in TinyDB and retrieving it to perform sums, but I’m having trouble passing the data through and performing the sum.

Please look.


The whole question is what a list of results should contain:

Front 1
Sum 25.4

Front 2
Sum 32.5

Tinydb saves:
((Front 1, 12, 13.4) (Front 2, 18.1, 14.4))

Key ideas

It seems each list item have three item but separated by commas.

Use for each item in the list.

Once you get the item either split at, or convert csv comma row to list

Then add 2nd item and 3rd item of this list

Add this result into a list.

Finally print the list. Understand?

Not
List
Convert csv

Hi dear,

Well, this first part is fine.
If you want, you can optimize it by setting puxadas directly when you initialize the variable.
Or by creating a separate function to add elements to a list in TinyDB.



Here I don’t really understand what you’re trying to achieve, and it would be useful to know how the data in pux listas is structured.

  • If expects a true/false input
  • index is a number, and I see that you’re segmenting a text and returning a 19-digit number

But first of all I’m interested in the content of pux listas.

I want to take
Front 1
10 + 18 = 38
add these items

I take Front 1 and try to add all the items index 3

What is this if checking?

The Kodular page is bugged.

It’s not moving components…

I want to take the name “Front 1” and sum all the items at index 3.

???

So I think it’s enough for you to do it like this.

It doesn’t work.

At the same time, I want to sum Front 2 also at index 3.

This would list Front 1 and its sum at index 3. (Front 2 sum index 3)

It would be like pulling from Google Sheets.

Select A, sum B, count C

If the list in pux listas is correctly formatted, it can’t fail

Optimized

Otherwise, explain better what you mean by “it doesn’t work”

Are you getting any errors?

Kodular page not responding

Frozen… I can’t move codes

I’m going to test this line of reasoning.

Use firefox, It’s known issue/bugs for more details check this : Drag&Drop issue in Kodular Creator Block window

Where is my mistake?

It doesn’t include the sum of Front 1.

Compare the text with the correct block.

Okay, so how do I retrieve the data from TinyDB to perform this calculation?

Mine was just a demonstration of what I was saying before,

namely that the function is correct.

And since everything works, I’d like to understand what’s not correct :grin:

?

=Select A, sum(B),sum(C), count(A) group by A
That’s how it will be via gviz

but I want to use TinyDB directly, doing it like in the table
except the data comes from TinyDB

Correct

on this basis

Not very elegant, but it works :grin:


With this procedure, you directly transform the CSV table into the query you were running with gviz.

I can retrieve this data from TinyDB.

I need to convert this data into a CSV file.

How do I change it?