cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Some question about filtering out unwanted relationship

dirkchin63
Node

Hi all, I could like to find out which pairs of stock price have correlation over 0.85 in last year.

I input the following in Neo4J:

MATCH (a)-[c:Correlation]-(b)
#Find out the relationship with correlation>0.85 & Exclude relationships with the stock itself (the correlation must be 1)
WHERE c.correlation > 0.85 and a<>b
Return *
The outcome:

I founded out there are 2 pairs with correlations higher than 0.85 (highlighted in yellow)
But some extra relationships (less than 0.85) are also included in the graph.
May I have some recommendations that how can I excluded those extra relationship when inputting order to Neo4J. Thanks!

1 ACCEPTED SOLUTION

dominicvivek06
Graph Fellow

can you uncheck connect result nodes under settings and test it.

Hello @dirkchin63, welcome to Neo4j community.

Please, match the exact relationship and relationship properties also.

2X_3_36298e0a5ff77404d918d520b536f5a22bd63be0.png

View solution in original post

2 REPLIES 2

dominicvivek06
Graph Fellow

can you uncheck connect result nodes under settings and test it.

Hello @dirkchin63, welcome to Neo4j community.

Please, match the exact relationship and relationship properties also.

2X_3_36298e0a5ff77404d918d520b536f5a22bd63be0.png

Done! I am a newcomer of Neo4J and Thank you very much for your help!