Hi. Recently i've posted a query(then solved) that was to sum string values, and if a label was upper that value it was returned like some kind of fraudulent entity.
Here's my query:
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
Now, i want to do the same query but instead use the set clause. I've made this way:
Match (e1:ENTIDADE)-[C:Contrato]->(e2:ENTIDADE)
WITH e1, sum(tofloat(replace(replace(C.Preco,".",""),",","."))) as sumPreco
SET(
CASE
WHEN sumPreco >50000
THEN RETURN e1 as FraudulentEntity, sumPreco
but it gives me this error:
Why? The clause's contruction is bad?
Thank you all and stay safe