Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-17-2018 02:38 AM
I am using this query and I used conditions to display only clusters which contains more than 3 contracts and 2 attributes but I am having a graph which contains clusters with only one contract .
match (n1:attribfxplaf)-[r]-(c:contratfxplaf)
with n1.clusterId as clusterId, count(n1) as attributaires, count(c) as contracts
where contracts > 3 and attributaires > 2
match (n2) where n2.clusterId = clusterId
return n2,clusterId
10-17-2018 10:18 AM
It's likely that the counts of contracts are counting the same node multiple times (the c
is the same for nodes in that match with the same clusterId
).
Try changing your query to count distinct nodes:
with n1.clusterId as clusterId, count(n1) as attributaires, count(DISTINCT c) as contracts
10-18-2018 06:10 AM
I am getting the same results !
10-18-2018 06:46 AM
use this query to help debug the problem ...
match (n1:attribfxplaf)-[r]-(c:contratfxplaf)
return n1.clusterId as clusterId, count(n1) as attributaires, count(distcint c) as contracts
order by clusterId
All the sessions of the conference are now available online