
1. Re: Counting Buckets
Deepak Rai Oct 11, 2019 12:18 PM (in response to Alex Dowd)Please attach a workbook

2. Re: Counting Buckets
Budi Lubis Oct 11, 2019 1:19 PM (in response to Alex Dowd)Hi Alex 
There are several ways to address your questions (i.e. bin). If you could give us a sample data and what you are trying to achieve or model, even better.

3. Re: Counting Buckets
Alex Dowd Oct 14, 2019 7:32 AM (in response to Budi Lubis)The information I'm using is CCI so I cannot share a workbook, however attached is a short excel document of the same type of data organized in the same way. My current method is to use a Histogram, however I'd like to be able to use calculated fields to just have a regular bar chart, or some other viz.

4. Re: Counting Buckets
Don Wise Oct 14, 2019 8:07 AM (in response to Alex Dowd)Hi Alex,
Try the following LOD calculation:
Buckets
{FIXED [Employee Number]: IF SUM([Tenure (Years)])>0 AND SUM([Tenure (Years)])<=3 THEN '0 3 Years'
ELSEIF SUM([Tenure (Years)])>3 AND SUM([Tenure (Years)])<=6 THEN '4 6 Years'
ELSEIF SUM([Tenure (Years)])>6 AND SUM([Tenure (Years)])<=10 THEN '7 10 Years'
ELSE '10+ Years' END}
You should get this:
It focuses on the Employee Number and then buckets each employee number into the matching ranges.
If this answers your question please mark it as correct so that others may find it in their search for a solution in the future. Best, Don How to Mark an answer as Correct
We would love to hear your feedback on your Tableau Community Forums experience.
Please take this 5 minute survey.


6. Re: Counting Buckets
Alex Dowd Oct 15, 2019 1:34 PM (in response to Don Wise)Don, so this worked mostly, however it's not working on all rows and I cannot figure out why. Any ideas?
For example  an employee with a tenure count of 0 is showing 03 years (correctly), but 4 is showing 10+ years. 
7. Re: Counting Buckets
Don Wise Oct 15, 2019 2:01 PM (in response to Alex Dowd)Hi Alex,
Not sure...I only had the small amount of flat data to work with so the mileage varies with actual results due to actual data volume, data structure, different systems, etc., can be a struggle !
The only thing I can think of is that when using a Level of Detail calculation like FIXED, if there are additional Dimensions in the worksheet that weren't are part of the provided data, then generally those need to be included in the calculation as well. For example, if you were also bringing in Employee Name or some other criteria then you'd want to put that field in with [Employee Number] ahead of the colon.
So it would look something like:
Buckets
{FIXED [Employee Number], [Employee Name]: IF SUM([Tenure (Years)])>0 AND SUM([Tenure (Years)])<=3 THEN '0 3 Years'
ELSEIF SUM([Tenure (Years)])>3 AND SUM([Tenure (Years)])<=6 THEN '4 6 Years'
ELSEIF SUM([Tenure (Years)])>6 AND SUM([Tenure (Years)])<=10 THEN '7 10 Years'
ELSE '10+ Years' END}
Best, Don