An expression to calculate rank

1026
2
03-23-2018 03:12 AM
by Anonymous User
Not applicable

All,

I am bit new to the expression engine in to modifiy the pop ups in ArcGIS online. I would like to write an expression that calculcates the rank of a country based on the amount it exports of a specific product.

To do this I believe I need:

  1. Count all the countries that are exporting (>0)
  2. Sort countries from Largest exported to Smallest
  3. Work out where the specific country is on the High to Low scale.

Thanks in advance for your help

Robin

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

wouldn't it be easier to pre-populate the file with the information using Pro?

Pro tools for this are available https://www.arcgis.com/home/item.html?id=90d9ca933e8c4b96bf341a20ae1f2514

XanderBakker
Esri Esteemed Contributor

I definitely agree with Dan, preprocess the data using Pro and the tool that Dan has created.

In ArcGIS Online the analysis that comes closest is the Find Outliers—ArcGIS Online Help | ArcGIS , but it isn't what you are looking for. As fa as I understand this probably will be possible in the future using ArcGIS Arcade | ArcGIS for Developers , but you will have to take into account the performance since Arcade will determine the value dynamically and for each feature a full table scan needs to be done to determine the rank and that will be expensive and might kill performance.