0
votes

I am new to tableau and need help in figuring this out.I have a dataset in below format:

hid:id for the house the customer belong cid:customer id

hID CustomerID
1   A
1   B
1   C
2   D
2   E
3   F
3   G
3   H
3   I
4   J
5   K
5   L
5   M
5   N
5   O

So A,B belong to house 1 so count of hid '1' is 3 so:

hid  count of members
1     3
2     2
3     3
4     1
5     5

I want to show a graph in tableau as size of house that is X-axis :Size of house and Y-axis :Count no of house with same size so for above data the values as below:

Size of house   no of house
1                     1
2                     1
3                     2
4                     0
5                     1

The final graph should be:

enter image description here

1

1 Answers

0
votes

In Tableau jargon, you're looking to bin based upon an aggregate value. Take a look at the following blog post for a more detailed description/walk-through.

One way to accomplish this is by leveraging talbeau's level of detail calculations. Creating a calculated field along the lines of:

{FIXED [hID] : COUNTD([CustomerID])}

You can then create a bin field by right clicking on the new field and binning based on a parameter, or a a static size (1?) of your choosing.

To create the visual, place this second bin field on the row shelf and on the column shelf drag the hID dimension and right click to convert to a measure by selecting Count Distinct.

As a side note, depending on whether you set your bin field as continuous or discrete, the 4 bin in your sample data will or will not appear.