Jul
22
Creating Bins via Math Formula
Zen Master Jonathan Drummey left a comment in Creating Bins Made Easy, saying that he is not using "IF ... ELSEIF..." statement when creating bins of equal size. Instead, he just creates a calculated field with some math wizardry. How brilliant! Jonathan's repertoire is infinite. Let's see how it works.
We use the same example as in Creating Bins Made Easy where we need to create bins of equal size on percentiles. The number of bins is 25. And we want to label the bins from 1 to 25. (If your number of bins is N, just replace 25 by N in the following.)
1.Via Ceiling()
The formula for the calc field is
Ceiling(Percentile*25) Ceiling() is a new function introduced in Tableau 9. However it doesn't work with table calculations.
We use the same example as in Creating Bins Made Easy where we need to create bins of equal size on percentiles. The number of bins is 25. And we want to label the bins from 1 to 25. (If your number of bins is N, just replace 25 by N in the following.)
1.Via Ceiling()
The formula for the calc field is
Ceiling(Percentile*25) Ceiling() is a new function introduced in Tableau 9. However it doesn't work with table calculations.