Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-18-2022 06:10 AM
I am trying to create a graph in neo4j using the following query:
LOAD CSV WITH HEADERS FROM 'file:///MyData.csv' AS row
MATCH (conta:Conta {nome: row.`Conta Origem`})
MATCH (contad:ContaD {nome: row.`Conta Destino`})
MERGE (conta)-[op:Movimentação]->(contad)
ON CREATE SET op.Valor = toFloat(row.Valor), op.`Tipo de Gasto` = row.`Tipo de Gasto`, op.`Tipo de movimentacao`=row.`Tipo de movimentacao`;
And the output is:
But this is not exactly what I want since the output is showing two graphs with the node 1
not connected; I mean, what I want is nodes 10
and 11
being connected to the red-centered node 1
.
The problem is that they are representing transactions through bank accounts, and accounts 11 and 10 are origin accounts to account 1 which, in its turn, is an origin account for all the others.
How can I proceed and change the query so I can get it right? I am new to cypher, so I am sorry if it is obvious.
A sample of the data is shown below:
All the sessions of the conference are now available online