I found one way to do it (line 3)... but if feels like it is not the best. I feel like I should be able to get the sum directly:
$feature["cluster_avg_CUSTOMERS_AFFECTED"];
var no_feature = $feature["cluster_count"];
var value = $feature["cluster_avg_CUSTOMERS_AFFECTED"] * no_feature;
var num = Count(Text(Round(value)));
var label = When(
num < 4, Text(value, "#.#"),
num == 4, Text(value / Pow(10, 3), "#.0k"),
num <= 6, Text(value / Pow(10, 3), "#k"),
num == 7, Text(value / Pow(10, 6), "#.0m"),
num > 7, Text(value / Pow(10, 6), "#m"),
Text(value, "#,###")
);
return label;
I found one way to do it (line 3)... but if feels like it is not the best. I feel like I should be able to get the sum directly:
$feature["cluster_avg_CUSTOMERS_AFFECTED"];
var no_feature = $feature["cluster_count"];
var value = $feature["cluster_avg_CUSTOMERS_AFFECTED"] * no_feature;
var num = Count(Text(Round(value)));
var label = When(
num < 4, Text(value, "#.#"),
num == 4, Text(value / Pow(10, 3), "#.0k"),
num <= 6, Text(value / Pow(10, 3), "#k"),
num == 7, Text(value / Pow(10, 6), "#.0m"),
num > 7, Text(value / Pow(10, 6), "#m"),
Text(value, "#,###")
);
return label;
Yep. That is one way to work around the issue for now. The problem with this, however is the size of the cluster doesn't adjust to use the sum. It still uses the average, which can lead to some really small sized clusters with larger numbers than clusters with a larger size.
This is something we should support. Still working on some details to help it fit with the existing API smoothly. No timeline at the moment.
Thanks for the feedback Kristian. Yes, the sizing issue is likely a deal breaker for me. I may not be able to use clustering at all until esri improves things.