Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-08-2023 04:34 AM
02-08-2023 04:38 AM
Sorry, I don’t understand the question. Will you please provide more detail?
02-08-2023 10:21 PM - edited 02-08-2023 10:31 PM
the csv file contain duplicate nodes and null values . a and b are persons and there relation is c. I'm trying to get a o/p without duplication and null values and along with that i need a single node 'Gary' which comes under the header B. here is the o/p ->
now i need one more node which is "Gary".
02-08-2023 04:39 AM
02-08-2023 04:45 AM
You filtered that row out, since A is null. What do you want to do with B, since A is null and the relationship can’t be created between A and B
02-08-2023 11:25 AM
Try this:
load csv with headers from "file:///newtask.csv" as row
WITH row WHERE NOT row.E IS null
CALL
{
WITH row
WITH row WHERE NOT row.A IS null
MERGE(p1:Person{firstName:row.A,age:row.E})
return p1, "yes" as flg
UNION
WITH row
WITH row WHERE row.A IS null and row.B is not null
MERGE(p1:Person{firstName:row.B,age:row.E})
return p1, "no" as flg
}
WITH row, p1, flg
MERGE(p2:Person{firstName:row.B})
WITH row, p2, p1, flg where flg = "yes"
CALL apoc.create.relationship(p1, row.C,{number:row.D}, p2) YIELD rel
RETURN rel
02-08-2023 10:36 PM
thank you
return p1, "yes" as flg
can you please explain me this part, it is confusing
All the sessions of the conference are now available online