Numeric Display not working properly with Count aggregation

Jonathan Allen shared this problem 7 years ago
Resolved

When trying to display a Count in a Numeric Display, instead of displaying the value of the count it displays the row count.


Example:

Attached are four screenshots. The first is "ThreeFields.png" showing a report with three identical values calculated three different ways. Of these three, the calculated count displays properly (CalculatedCount.png) while the other two just show "1" (CountOfMetric.png and CountOfDimension.png). If I change the starting report to have 3 rows, the counts will instead show 3 rather than the actual count value.

Replies (3)

photo
1

Also worth noting, the digital numeric display chart works as expected, but we would prefer the look of the simple numeric chart.

photo
1

Hi Johnathan,


Thank you for getting in touch. While there is a known bug with the sum aggregation of the auto chart (that is fixed and will be included in the upcoming release), this feature should work in the numeric display chart. It is worth noting that at the chart level, aggregations will apply on top of your data. So count will return the row count, while sum will return the sum of values in the field. It sounds in your case like applying the sum aggregation on a count field is more appropriate.


Please let me know your thoughts on this.


Regards,

Nathan

photo
1

Hi Nathan,

I used a generic example to demonstrate the issue, but what I want to display in the numeric display is a count of rows from one of my tables. Attached is another example showing the Data step (Data.png) and Chart step (Chart.png). In this case I want to be able to display the Count from the Data step in the Numeric Display. As you can see the Numeric Display instead shows a value of '1'. Using the Digital Numeric Display I get the expected value (Digital.png).

photo
photo
1

Hi Johnathan,


Do you have a few minutes to screen-share today? If so please let me know what time works best for you. (I am on US Mountain Time)


Regards,

Nathan

photo
1

Hi Nathan,

I was out yesterday, but this morning I actually figured out my issue. I didn't realize that the numeric display does an additional aggregation on top of the existing aggregation in the data step. In this case, I had a count in my data step that I wanted to display in the numeric display, but then the numeric display was doing another count aggregation on that field. To get around this, I just have to set the chart-level aggregation to SUM (or MIN, MAX, AVG). See the attached screenshot showing what I mean.

This wasn't very intuitive, but I understand why it is designed this way. I think the confusing part is that it defaults to a count of a count whereas a SUM might be a more common use case, but I could be wrong there. It also wasn't clear to me that my already aggregated field was being aggregated again by the chart.

photo
1

Hi Johnathan,


Glad to hear! As I said in my original response and as you have noticed, these aggregations are applied on top of the final data-set, so a count will count the results (rows), and a sum will sum the results. While this can be a bit confusing, there are many use cases where being able to apply a second set of aggregation is very advantageous. (Moving averages, count results, etc)


I am going to close this case for now, but if you run into any additional problems, let me know!


Regards,

Nathan

photo
Leave a Comment
 
Attach a file