I have a dashboard in AGOL which was created before the September 2021 update (not sure if that's relevant but thought I'd mention).
I have an indicator based on a feature layer which for the majority of the time will have no records in but occasionally will have some records.
The indicator is set to use a statistic as the value type and to return a COUNT on the OBJECTID field. When there are no records in the dataset the value returned is 0 rather than being no data.
However if I change the statistic to SUM and point it at any numeric field then the no data message is returned rather than a 0.
I can make use of the No data label settings to simulate the number 0 in this instance but the text formatting options are different between no data labels and the indicator text, so it's tricky to replicate these exactly if I want to show two similar indicators side by side, one with a count and one with a sum.
Just wanted to see if anyone knew if this is expected behaviour or if there is any other workaround to try and achieve the desired effect.
I believe that should be the expected behavior, and it makes sense.
A COUNT of 0 means there is no feature/ record.
A sum of 0 (for a field) means there are valid records whose sum (of a field) equals to 0. "No Data" suggests there is no record to calculate the statistics.
I get what you're saying but if a COUNT of 0 means no feature/record then why not show (or at least give the option for) the No Data label instead? That way the user has the choice of showing whatever they want including a 0 and it is consistent with other statistics returned.
I'll maybe suggest this as an idea for enhancement.
You get No Data when the indicator is actually looking for a value in the data, such as an attribute. Count is a special case, because it's not looking at the data's contents, simply the number of records present.
Put another way, asking "what's the average value" of no records can't be answered definitively, thus the No Data response. Asking "how many are there" of no records can be answered.
You can use conditional formatting, if all you want is something else to display when the count is 0.
Set a reference value of 1.
Then set the "below reference" style to whatever you want.
Now a count of 0 will display with whatever message you enter, rather than a 0.