Overlapping bins Tableau

46 Views Asked by At

I am trying to create a dashboard with overlapping bins with 30 day interval. For ex. 1st bin would have data from 23rd Jan - 25th Dec. 2nd bin would have data from 22nd Jan - 24th Dec…16 more such bins. But if I use if else or iif statements it just displays all data for bin 1. But from bin 2 onwards it just displays 1 date data that is not present in previous bin. For ex. Bin 2 will only display data for 22nd Jan since the rest is already present in Bin 1.

I tried case when, if elseif, iif statements

1

There are 1 best solutions below

2
On

Fields have a single value - so bins or calc fields as you describe won't overlap - each data record will have a single value putting it in one "bin".

If you want to assign each data record to multiple bins or categories, then you need multiple fields or bins, one for each bin or category. For example, if you have a dataset of people, you could define one boolean valued field called [Has_College_Degree?] and another boolean field called [Income_Over_70k?]. You could also use sets instead of calculated fields.

Then you need a little more effort to create the chart you want. Here's one example way to turn these boolean fields into charts.

Create a field called say Num_with_Degree defined as INT([Has_College_Degree?]) INT() converts True to 1 and False to 0. So if you put SUM([Num_With_Degree]) on a shelf, you'll get the number of data records that had [Has_College_Degree?] = True. Do the same with others.

You can then use Measure Names, Measure Values and the Measure Values shelf to show multiple measures in the same table or chart. For example, to break down survey respondents by various overlapping demographic criteria.