|
POST
|
If I understand your scenario correctly, each feature may have a number of related features. You want to sort those related records, not the feature itself. var relatedRecords = FeatureSetByRelationshipName($feature, "the relationship name");
var order = OrderBy(relatedRecords, "Treat_Date DESC");
var latest = First(order);
Iif(DateDiff(now(), latest.treat_date, 'months') < 12, "Treated", "Requires Treatment")
... View more
03-12-2024
04:11 PM
|
0
|
1
|
1261
|
|
POST
|
You can Push the results into an array and use Concatenate to put them into a comma-separated string if (Count(records) == 0) return "No maintenance needed";
var output = [];
for (var f in truerecords) {
Push(output, f.Main_Type)
}
return Concatenate(output, ', ')
... View more
03-12-2024
03:59 PM
|
1
|
0
|
5599
|
|
POST
|
You're checking if PT_STATIC and PT_RESIDU are empty, but not if PT_STATIC - PT_RESIDU = 0. If that's the case, x will have a value of Infinity
... View more
03-12-2024
10:45 AM
|
1
|
1
|
4774
|
|
POST
|
Do you have a relationship set up between the FeatureSet and the related table? If so, you can use this syntax to get the related records var related = FeatureSetByRelationshipName($feature, "the relationship name"); If not, then you'll get the related records by filtering the table using the common field (relateField, in this example). var relTable = FeatureSetByName($map,'table', ['*'], false);
var attribute = $feature.relateField;
var related = Filter(relTable, "relaterField = @attribute"); From that, filter the related records for the ones that need maintenance. var records = Filter(related, "MaintenanceNeeded = 'True'");
if (Count(records) = 0) return "No maintenance needed";
var output = "Maintenance Needed: " + TextFormatting.NewLine;
for (var f in records) {
output += " " + f.MainenanceType + TextFormatting.NewLine;
}
return output;
... View more
03-08-2024
01:30 PM
|
2
|
6
|
5706
|
|
POST
|
Line 21 should be inside the for loop. for (var f in Hydrants) {
var f_CalcStaticPSI = Number(f['CalcStaticPSI'])
var f_MeasuredPSI = Number(f['MeasuredStaticPSI'])
var f_PSIDifference = Number(sum(f['CalcStaticPSI']- f['MeasuredStaticPSI']))
Push(out_dict['features'], {'attributes': {'CalculatedPSI':f_CalcStaticPSI,'MeasuredPSI': f_MeasuredPSI,'PSIDifference':f_PSIDifference}})
}
... View more
03-08-2024
11:51 AM
|
0
|
1
|
1684
|
|
POST
|
Esri has a Github page containing a number of different Arcade expressions. The Aggregate by Spatial Relationship example in the Dashboard section might be what you're looking for.
... View more
03-05-2024
01:24 PM
|
0
|
1
|
1233
|
|
POST
|
I'm able to dissolve on a text field. Can you provide a little more information or screen shots on what's happening?
... View more
03-05-2024
12:24 PM
|
1
|
2
|
1886
|
|
IDEA
|
@SSWoodwardI'm using ArcGIS Pro 3.2.2 and this is in the Configure Popup dialog. Click on the Arcade icon and edit icon on the element itself.
... View more
03-04-2024
12:15 PM
|
0
|
0
|
5095
|
|
IDEA
|
I don't see this option available on the Arcade Element editor.
... View more
03-04-2024
11:25 AM
|
0
|
0
|
5126
|
|
POST
|
Since your data is private, I can't test it. However, I was able to test using a public service and it worked as expected, returning two items in the table with the maximum value for each aggregationMethod var fs = FeatureSetByPortalItem(
Portal("https://www.arcgis.com"),
// portal item id
"7b1fb95ab77f40bf8aa09c8b59045449",
0, // layer id
["*"], // fields to include
false // include or exclude geometry
);
GroupBy(fs, 'aggregationMethod', {name: 'TOTPOP_CY', expression: 'TOTPOP_CY', statistic: "MAX"})
... View more
03-04-2024
10:13 AM
|
0
|
1
|
2795
|
|
POST
|
When using variables, don't encase them in quotes. var maxvotes = GroupBy(fs, 'Precinct_Name', {name: 'Reg_voters', expression: 'Reg_Voters', statistic: "MAX"})
... View more
03-04-2024
09:41 AM
|
1
|
5
|
2811
|
|
POST
|
You can use the Replace function to get rid of those strings, but you have to be careful. The Arcade interprets a backslash as part of an escape character, so you have to use it twice in Replace for it to work properly. This will replace either in a single line. var output = Replace(Replace($feature.Hyperlink,'\\\\mcenas01\\',''),'R:\\','');
... View more
03-04-2024
09:38 AM
|
1
|
0
|
1643
|
|
POST
|
The first parameter of the GroupBy function is the FeatureSet that contains the data, which should be fs. The out_dict variable is just an empty FeatureSet you've created.
... View more
03-04-2024
09:22 AM
|
0
|
8
|
2833
|
|
POST
|
You're using out_dict in the GroupBy, but you haven't assigned any records to it. Why aren't you using fs in the GroupBy?
... View more
03-04-2024
09:13 AM
|
0
|
10
|
2845
|
|
IDEA
|
It would be even more helpful if when you hovered over the group icon, it would tell you what group it was. ArcGIS Assistant used to have this capability until the latest update removed it.
... View more
03-04-2024
07:21 AM
|
0
|
0
|
1744
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|