Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-13-2022 01:34 PM
Newb to Neo4j, I was successfully able to leverage apoc.coll.avg , apoc.coll.min & apoc.coll.Max but I'm receiving an error when trying to use apoc.coll.runningTotal
WITH apoc.coll.runningTotal([1,2,3,4,5]) AS d RETURN d
Unknown function 'apoc.coll.runningTotal' (line 2, column 6 (offset: 18)) "WITH apoc.coll.runningTotal([1,2,3,4,5]) AS d"
Solved! Go to Solution.
10-13-2022 09:21 PM
It looks like it does not recognize that function. I would ask if you have apoc installed, but you said you successfully used the collection's min and max functions. Try running the following query to see if the apoc.coll.runningTotal function is in the list.
show procedures where name starts with 'apoc'
10-14-2022 01:52 PM
that is a bummer. I created a cypher expression that will calculate the runningTotal for you. Here it is in an example. Use the expression on line 2 for calculating it.
with [1,2,3,5,10] as coll
with [i in range(1,size(coll)) | reduce(s=0,x in coll[..i]|s+x)] as runningTotal
return runningTotal
10-13-2022 01:52 PM
I copied and pasted your one line into neo4j browser and it worked.
10-13-2022 02:10 PM
First, thank you!
Not sure what am I missing.
10-13-2022 09:21 PM
It looks like it does not recognize that function. I would ask if you have apoc installed, but you said you successfully used the collection's min and max functions. Try running the following query to see if the apoc.coll.runningTotal function is in the list.
show procedures where name starts with 'apoc'
10-14-2022 08:44 AM
You are correct,
It's appear that apoc.coll.runningTotal is not part of the list
10-14-2022 09:04 AM
There are two versions of the APOC jar. One is a 'full' version and one is a 'core' version. I switched mine to 'core' and did not see the procedure in the list. Look in your plug-ins folder. The jar's name has 'core' in it.
If you have the core, I think you can remove it from the plug-ins folder and install the full version with the Neo4j Desktop under the 'plugins' tab.
10-14-2022 09:11 AM
Oops...My mistake. apoc.coll.runningTotal is a function. As such, you need to execute the following query for functions:
show Functions where name contains 'apoc.coll'
10-14-2022 09:19 AM
I replaced my full version with the 'core' jar. The functions exists in the 'core' jar as well, so this can't be the issue.
Sorry, but I do recall a couple of people having similar issues with apoc. Maybe try a reinstalling apoc.
10-14-2022 10:42 AM
Thanks a bunch! I currently using Neo4j through Aura and per the support team it's not supported. Do you recommend me to use another neo4j flavor? Once again I'm a newb to Neo4j.
10-14-2022 01:52 PM
that is a bummer. I created a cypher expression that will calculate the runningTotal for you. Here it is in an example. Use the expression on line 2 for calculating it.
with [1,2,3,5,10] as coll
with [i in range(1,size(coll)) | reduce(s=0,x in coll[..i]|s+x)] as runningTotal
return runningTotal
10-16-2022 01:43 PM
This is awesome! thank you for taking the time.
greatly appreciate.
10-14-2022 01:02 AM
You could also check your apoc version with `RETURN apoc.version() AS output;`
FWIW it's working for me on 4.4.0.6
10-14-2022 08:39 AM
My version is "4.4.0.9".
All the sessions of the conference are now available online