Hello, I'm trying to assign a "rank" to nodes based on a property. In this case, I have Persons, and they have Calls.
The higher the call amount, the "better" the rank. People who are tied for Calls should have the same rank (as seen in the image below):
My current code:
match(p:Person)-[:HAD_CALL]->(e:Call)
with p, count(e) as test
with collect([p, test]) as nodes
unwind range(0, size(nodes)-1) as rank
return nodes[rank][0].name as PersonName, nodes[rank][1] as Count, rank order by Count desc
My code gives results like this (I have nearly ~100,000 nodes):
Is there any way for me to rank nodes based on a property value, while cleaning handling ties?
Thank you!