Total card is not displaying the sum of two metrics correctly as it aggregates them as a string instead of applying addition

When using the Bar Chart, I get this error of aggregating Sums as a String instead of adding them up as normal numbers.

I have also enabled this “Show total card” style in order to show these numbers.

Did anybody encounter this problem before? How did you fix it?

2 Likes

Hey,

Hope you’re keeping well.

This usually happens in Looker when the underlying field types are defined as string rather than number in your LookML model. The “Total” card will concatenate string values instead of performing numeric aggregation. Check the field definitions in your view file and ensure the type is set to number (or the appropriate numeric type) and that measures use sum or another numeric aggregation. After updating the LookML, run a content validation and refresh the explore to confirm the totals calculate correctly.

Thanks and regards,
Taz

Hi Taz,

I’m having the same issue despite my fields being defined as number instead of string. That does not seem to fix this bug.

Link to my post: Total card concatenates values instead of adding them up for calculating the total for stacked columns

Sorry for the trouble. I am unable to reproduce the problem. Does this happen on multiple reports/charts/data sources or is it isolated to a specific instance?

If you can create an example report that demonstrates the problem and share it here, that would be helpful.

Thanks!

Hi Rick,

It affects only that one chart you can see in my post. Would it help if I gave you access to the dashboard?