Good morning, I'm looking to make a rather simple ARCADE formula:
the sum of the Shape__Length field with a filter on one field (frequency different from 0 in my case)
Here is where i am now
var Sum =Sum($layer, "Shape__Length")
var filter = Filter(Sum, $feature.FREQ_ENTRETIEN !=0)
return filter
thanks a lot for your help
Aurelian
Hi Aurelian,
I think it'd work if you just flipped the first two lines, filtering the $feature.FREQ_ENTRETIEN !=0 values out before you sum them. Just make sure to then put the filter variable into the sum function instead of $layer.
Cheers,
Josh
Hi Aurelien,
The expression you have created is almost correct but needs a small correction to filter the layer before summing the Shape__Length field.
var filter = Filter($layer, $feature.FREQ_ENTRETIEN != 0);
var Sum = Sum(filter, "Shape__Length");
return Sum;
Best,
Omar
Hello to both of you
Thanks for your help.
The solution was ultimately
var filter = Filter($layer, 'FREQ_MAINTENANCE <> 0');
var Sum = Sum(filter, 'Shape__Length');
return Sum;
In the Filter function, the condition must be in SQL.
Again thanks to you
Bye