Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-12-2022 05:12 AM
I’m new in neo4j and I need some help
I have two nodes end relationship between them as invoice with invoice amount, there are a lot of invoices between two company-nodes, I need to summarize relationships amounts and use this syfer in bloom
I tried to write down this query
match (n:company {comp_ID:$parameter})-[r:invoice]->(m:company)
with n, m, sum(r.amount) as total, collect(r) as relationships
where size(relationships) > 1
with total, head(relationships) as keep, tail(relationships) as delete
set keep.w = total
08-12-2022 05:48 AM
08-12-2022 05:59 AM
unfortunately i cant get results in bloom 😞
this is the amounts of invoices, i want to sum relationships but
bloom can not find any results by parameter search
08-12-2022 06:02 AM
It looks like your store the total in the w property. Can you verify that the property exists using Neo4j Desktop?
08-12-2022 06:30 AM
when I run this query in neo4j desktop :
match (n:company)-[r:invoice]->(m:company)
with n, m, sum(r.amount) as total, collect(r) as relationships
where size(relationships) > 1
with total, head(relationships) as keep, tail(relationships) as delete
set keep.w = total
it says that
‘Set 1 property, completed after 2 ms.’
After I run all nodes and it shows me this
Where amount 700 000 is collected new relationship and unnamed relationships are old ones
08-12-2022 06:56 AM
So it sums everything in the same relation?
08-12-2022 06:59 AM
I don't know well but i want in bloom to be left only summarized relationship
08-12-2022 07:01 AM
Then delete other relationships?
08-12-2022 07:08 AM
I don't need them to be deleted, just hide or something like this, and i dont know how to execute this query in bloom because its not working
08-12-2022 06:15 AM - edited 08-12-2022 06:31 AM
1
08-14-2022 11:55 PM
is it possible in bloom to ad this query in scene action and get some results?
match(n:piri)-[r:miwodeba]->(m:piri)
where id(n) in $nodes
with n, m, sum(r.Rirebuleba) as total, collect(r) as relationships
where size(relationships) > 1
with total, head(relationships) as keep, tail(relationships) as delete
set keep.w = total
foreach(r in delete | delete r)
return *
All the sessions of the conference are now available online