Select to view content in your preferred language

Can't Sum Integer Field (but can sum small integer)

33
2
5 hours ago
Labels (1)
ZachBodenner
MVP Regular Contributor

Hello everyone,

I'm working with Arcade here in Experience Builder dev edition 1.19. I want to run a sum function on a filtered featureset, but I'm running into a strange issue where Small Integer fields (and doubles) can be summed, but Integer (long integer in my dataset) cannot. Here's the fields of the map service:

ZachBodenner_2-1766772344575.png

 

And here's trying to sum a small integer (note, not really a field I actually want to sum, just using it to illustrate the point)

var fs = getFilteredFeatureSet($dataSources["dataSource_12-18c82b170ef-layer-17"]);  // Assessed Value

//var integerField = sum(fs,"Assessed_Value")
var smallIntegerField = sum(fs,"Quintile_Year")


return {
  value: smallIntegerField,
  text: {}
};

ZachBodenner_0-1766772176413.png

 

But, when I attempt to sum a field that is simply an Integer...

var fs = getFilteredFeatureSet($dataSources["dataSource_12-18c82b170ef-layer-17"]);  // Assessed Value

var integerField = sum(fs,"Assessed_Value")
//var smallIntegerField = sum(fs,"Quintile_Year")


return {
  value: smallIntegerField,
  text: {}
};

ZachBodenner_1-1766772228669.png

This one has me stumped. Anyone run into this yet?

Happy mapping,
- Zach
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

why are lines 8 in both images the same? (eg smallIntegerField)

did you forget to change line 8 to integerField in line 8 in the second image?


... sort of retired...
0 Kudos
ZachBodenner
MVP Regular Contributor

Heh yes I did forget to change that but the error message is coincidentally the same which is probably why I missed it. I've continued testing too and it does seem like other math functions like min(), max() and mean() all work on the long integers, it's just sum() that is causing the error. I've tested with multiple long integer fields in multiple datasets at this point.

Happy mapping,
- Zach
0 Kudos