Precision Threshold of Count in Canvas

I just confirmed with the ES SQL team that aggregation like this is imprecise and unfortunately there isn't a way to tell the SQL endpoint to change the precision threshold. You might consider opening a ticket in the elasticsearch github repo with this feature request for the SQL team.

As for the second example that uses the math function to count unique values, I'm a little surprised this isn't working. Are there any filters being passed in that would hide some expected data?

If all else fails and you were able to create a visualization outside of Canvas that pulls your data that you want, you can add that visualization directly to a workpad