I need to normalize the math scores that are stored as a property on the node and then update the same property with a normalized value. I have tried this:
WITH COLLECT(r.score) as myScores
UNWIND myScores as x
WITH myScores, min(x) as n, max(x)-min(x) as den
WITH den, myScores, [val in range(0, size(myScores)-1) | round((myScores[val]-n)*100/den)/100] as g
RETURN g, myScores
The above query gives me the correct results in two lists but I am not able to find a way to update r.score with the values in list g.
Please, can someone help?