So I feel like this is something I should have been able to figure out but I am terrible with Arcade. I have a feature layer that contains ACS data. I would like the pop-up to be configured so that, when I select a census tract, I can see how that tract compares to others. For example, click on Census track 12 and see that, out of 25 tracts, it ranks #1 for homes without broadband. Part of my pop-up Arcade figures out the percentage of households without internet out of total households for the census tract but I can't get it to compare that to all the other features and return its rank for that. I've tried to set up arrays but none of them worked so I did not include them in this snippet.
var householdNoInternet = $feature.InternetComputerUsage_ACSNONET;
var totalHouseholds = $feature.TotalHouseholds;
var internetRatio = householdNoInternet / totalHouseholds;
var accessrank = $feature.INDEX_RANK; //different rank than what I am looking for
var locationName = $feature.Name;
var html = "<b><h2>" + locationName + "</h2></b>";
html += "<b><h3>Access Ranking: " + Text(accessrank) + " out of 25</b></h3>"
html += "<br><h5>Households with No Internet: </h5>" +
Text(Round(householdNoInternet)) +
" out of " +
Text(Round(totalHouseholds));
html += "<br>Percentage: " + Text(Round(internetRatio * 100, 1)) + "%";
html += "<br>Rank "+ Text(index) + " out of 25"; //rank of individual element I am trying to calculate
return { type: "text", text: html };/*
How would you determine which 25 tracts to use? Is your dataset only those 25 tracts?