Last Modified Date: 18 Oct 2019
- Tableau Desktop
- MS SQL Server
Option 1Convert the field being binned from integer to float before creating the bin.
Option 2Use a calculated field to create bins.
FLOOR([VAL]/[Bin Size])*[Bin Size]
CauseBins 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 InformationSQL Server 2017 Document: / (Division) (Transact-SQL)
Discuss this article...
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials