I would like to add a calculated field to a feature layer.
I would like to add a count() of all rows in a feature class that contain the value of a specific column.
e.g. I have a feature class of pharmacies in california. if a row has CVS as the type of pharmacy I would like a calculated field count() of all rows in the feature class that have CVS as a pharmacy type.
The feature class may have hundreds of CVS pharmacies, CVS hollywood, CVS brentwood, CVS Malibu etc.
Every row for pharmacy type CVS would have the total number of CVS type pharmacies in california in the calculated field.
Example: For demo purposes CVS has 3 pharmacies, Walgreens has 4
Feature Class Pharmacies
PharmacyType, PharmacyLocation, Calculated field(count() of pharmacy type)
CVS Hollywood 3
CVS Brentwood 3
CVS Malibu 3
Walgreens Hollywood 4
Walgreens Brebntwood 4
Walgreens Malibu 4
Walgreens LA 4
I succesfully did this by adding a custom arcade attribute in webapp builder, but for some reason adding this custom attribute causes the export to CSV to fail, even if is not part of the attribute table. Please DO NOT recommend using Experience Builder, since Experience builder is lacking in several WebAppBuilder Features.
Solved! Go to Solution.
I haven't recieved any suggestions for this, so I think I will write some python code to update the field
Hello @KurtRadamaker1 , regarding this part of your description:
"for some reason adding this custom attribute causes the export to CSV to fail"
Are you able to post any error messages, or screenshots, or sample CSVs etc, detailing this failure to export ?
Turns out this a known bug, csv will fail if you have any feature sets in a custom attribute.
I haven't recieved any suggestions for this, so I think I will write some python code to update the field