Dataview sum problem

Hi Obsidian Lovers.

I’m trying to use the function sum in the dataview.

this is a sample of the table I need to use:


dati:

  • nome: pippo
    cifra: 200
  • nome: pluto
    cifra: 150
  • nome: pippo
    cifra: 100

these are he query

table entry.nome as "Nome", entry.cifra as "Cifra"
from "TestDati"
flatten dati as entry
table sum(entry.cifra) as "Somma Totale"
from "TestDati"
flatten dati as entry
group by null
table entry.cifra as "Cifra", typeof(entry.cifra) as "Tipo"
from "TestDati"
flatten dati as entry
table entry.nome as "Nome", sum(number(entry.cifra)) as "Totale Cifra" 
from "TestDati" 
flatten dati as entry 
group by entry.nome 
sort sum(number(entry.cifra)) desc

and the results

File3	Nome	Cifra
TestDati	pippo	200
TestDati	pluto	150
TestDati	pippo	100
null1	Somma Totale
-	-
File3	Cifra	Tipo
TestDati	200	number
TestDati	150	number
TestDati	100	number
entry.nome2	Nome	Totale Cifra
pippo	-	-
pluto	-	-

as you can see the sum function is not working.

Where is my mistake?

thanks