Last Modified Date: 18 Oct 2019
Environment
- Tableau Desktop
- MS SQL Server
Resolution
Option 1
Convert the field being binned from integer to float before creating the bin.Option 2
Use a calculated field to create bins.FLOOR([VAL]/[Bin Size])*[Bin Size]
Cause
Bins are computed by using the FLOOR function in SQL but if the value is an integer field, the bin size also happens to be an integer. When you divide two fields that are integers in SQL, it will truncate the decimal part of the result.For example, the negative values near zero, we get -14/15 = TRUNC(-14/15) = 0. That is resulting in the behavior.
Additional Information
SQL Server 2017 Document: / (Division) (Transact-SQL)Discuss this article... Feedback Forum
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials