Hi.
I'm new in neo4j and i have a question that i've already tried to solve but nothing.
So, i'm doing a graph and at certain point i have to sum values that i have in a json file, but the value of the field is in string. Here's what i have:
I think it's not working since in your string there is a "." and a ",".
So you can try to replace the "." and after convert your number to a float.
You can do like this:
Ok nice, it worked. It has converted to float. But how do i sum those values? Just have to put: return sum(tofloat(replace(replace(C.Preco,".",""),",","."))) ?
I want to sum the value of all Contracts that i have(Contrato in the graph), and that attribute is "C.preco" and IF that sum is > 50.000 i want to, somehow, represent on the graph saying that the center Entitity(506858286) is comitting a fraud. Is that possible? I know that neo4j has not if/else clause
Match (e1:ENTIDADE) -(c:CONTRATO)->(e2:ENTIDADE)
With e1, sum(tofloat(replace(replace(C.Preco,".",""),",","."))) as sumPreco
Where sumPreco >50000
Return e1 as Entity, sumPreco
As you are using European number system you can transform 50.000 as per need
This is what i get.
I had to change: Match (e1:ENTIDADE) -(c:CONTRATO)->(e2:ENTIDADE) to Match (e1:ENTIDADE) -[C]->(e2:ENTIDADE) because it gives me error if i have (c:contrato) and not [c]
Oh, ok, i tought it would appear the graph and some kind of label in the FraudulentEntities. After i see the tables i've understood that neo4j is returning me only the FraudulentEntities. Thank you friend!
Have a nice day, and stay safe!