Select to view content in your preferred language

Filter a layer using a dynamic relative-value

774
5
09-16-2024 09:03 AM
RobertoRossi
Frequent Contributor

In a map I’m using a dynamic layer (WFS) which updates daily, containing rain gauge data.

I would like to filter the layer (using the rain amount numeric filed) in order to show only the highest precipitation value feature. When I try to filter the layer using the numeric field I just find only absolute filter expressions:

RobertoRossi_0-1726502224414.png

which apply to a particular value.

Is there a workaround to filter by the greatest value (like Relative-date filters do)?

Roberto

 

5 Replies
KimOllivier
Honored Contributor

I appears that the field item is not recognised as numeric. I am also wrestling with WFS feeds being read only and intermittent. My idea is to copy the WFS feed to a real Feature Layer daily that you have full control over the schema and also filters. This is easy from Pro, but not ideal and not automated. So maybe a AGOL Notebook with a Task to refresh each night?

I found Arcade is disabled for WFS layers so that is not an option.

0 Kudos
RobertoRossi
Frequent Contributor

Thank you @KimOllivier , In one version of my Map I already designed a join from a Feature Layer from CSV to a Feature Layer using Data Pipelines: this is the Output Feature Layer: https://arcg.is/eX1qO

The problem is that it seem impossible to filter the layer using the maximum value of numeric field.

Maybe it is possible a workaround using Arcade configuring an expression in styles (or even labels), but I need some help with Arcade...

0 Kudos
KimOllivier
Honored Contributor

"Not all Arcade functions are suitable for every profile. For example, profiles that execute expressions for all features in a layer (e.g. visualization and labeling) don't allow expressions to access data via FeatureSet functions."

I don't think you are allowed to use Arcade in a map filter because of the overhead implied. You will have to process the highest value earlier before the data is in a MapView.

0 Kudos
RobertoRossi
Frequent Contributor

:@KimOllivier , you are right, Arcade is not available in map filters: that's way  I was wondering there could be a workaround via styles or labelling...

0 Kudos
KimOllivier
Honored Contributor

The only way I have done this is by using the Python API and Pandas to find the maximum value and then update a field

0 Kudos