Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
12-13-2020 01:30 AM
neo4j : several recent versions, apoc: several recent versions
I tried it in https://guides.neo4j.com/4.0-intro-graph-algos-exercises/LabelPropagation.html
UNWIND ['distance','inverse_distance'] as property
MATCH (:Place)-[r:EROAD]->(:Place)
RETURN property, apoc.agg.statistics(r[property]) as stats
It returns this error:
Neo.ClientError.Procedure.ProcedureCallFailed
Failed to invoke function apoc.agg.statistics
: Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
Solved! Go to Solution.
12-14-2020 08:27 PM
It seems like the solution to the exercise left out the percentiles parameter from the apoc.agg.statistics() function. The correct syntax should be
UNWIND ['distance','inverse_distance'] as property
MATCH (:Place)-[r:EROAD]->(:Place)
RETURN property, apoc.agg.statistics(r[property], [0.5,0.75,0.9,0.95,0.99]) as stats
Hope this helps!
-Jorge
12-14-2020 08:27 PM
It seems like the solution to the exercise left out the percentiles parameter from the apoc.agg.statistics() function. The correct syntax should be
UNWIND ['distance','inverse_distance'] as property
MATCH (:Place)-[r:EROAD]->(:Place)
RETURN property, apoc.agg.statistics(r[property], [0.5,0.75,0.9,0.95,0.99]) as stats
Hope this helps!
-Jorge
12-14-2020 11:45 PM
Yes, it works now!!
Thank your for the help.
Hope God bless you.
All the sessions of the conference are now available online