Hi I need you.
I would divide a count between 2 data, I have added up all the reviews on my site and all the stars my clients give me.
Now I would make a division between all reviews (totalP) and all stars (sumP) that I would like to see them on the Evaluation Display this is the code:
import wixData from ‘wix-data’ ;
$w . onReady ( function () {
wixData . query ( "Recensioni " )
. count ()
. then (( result ) => {
$w ( ‘#totalp’ ). text = result . toString ()
})
wixData . aggregate ( “Recensioni” )
. sum ( “valutaRecensione” , “sumP” )
. run ()
. then (( result ) => {
var valutaRecensione = result . items [ 0 ]. sumP
$w ( ‘#sumP’ ). text = valutaRecensione . toString ()
})
Thanks for your help.