Describe the bug
Pretty much the title. I've attached the data layer I am using for calculation, but this screenshot summarizes the issue.

The results are scary when "concatenate" with delimiter is used, for exampleconcatenate(str, NULL, NULL, ' | ') or count_missing(str).
Expectations
I was expecting that NULL values are going to be omitted as they do not represent countable values. This is already the case for aggregates for numeric types.
Reading the documentation, especially on the count_missing, it states only NULL values should be counted.
https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/expression.html#aggregates-functions
| Function |
Description |
| count |
Returns the count of matching features |
| count_distinct |
Returns the count of distinct values |
| count_missing |
Returns the count of missing (null) values |
How to Reproduce
- load the attached layer
aggr.zip
- this is the expression I'm using to display the result. Any other aggregate function is also affected.
'\ncount(int) ' || count("int") ||
'\ncounr(str) ' || count("str") ||
'\nmissing(int) ' || count_missing("int") ||
'\nmissing(str) ' || count_missing("str")
QGIS and OS versions
All QGIS3 versions on all platforms, it is in the very core of how statistics for strings work.
Additional context
Applying the fix breaks a few existing unit test, but also might break user expressions dependent on this bug.
Once we agree this is an issue, I already have a fix on my branch here:
suricactus@27264be
Describe the bug

Pretty much the title. I've attached the data layer I am using for calculation, but this screenshot summarizes the issue.
The results are scary when "concatenate" with delimiter is used, for example
concatenate(str, NULL, NULL, ' | ')orcount_missing(str).Expectations
I was expecting that
NULLvalues are going to be omitted as they do not represent countable values. This is already the case for aggregates for numeric types.Reading the documentation, especially on the
count_missing, it states onlyNULLvalues should be counted.https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/expression.html#aggregates-functions
How to Reproduce
aggr.zip
QGIS and OS versions
All QGIS3 versions on all platforms, it is in the very core of how statistics for strings work.
Additional context
Applying the fix breaks a few existing unit test, but also might break user expressions dependent on this bug.
Once we agree this is an issue, I already have a fix on my branch here:
suricactus@27264be