7 Replies Latest reply on Apr 11, 2016 10:21 AM by Geoffrey Cleaves

# Another desperate plea for table calculation help - churn

Please find attached an example workbook that does some client churn analysis using table calculations. I can't quite get it just right, despite using Yuri Fal 's example.

My problems are:

• How do I count these danged squares and display the count instead of squares in a simple text table?
• How do I stack these bars contiguously?

Geoff

• ###### 1. Re: Another desperate plea for table calculation help - churn

Hi Geoffrey,

Please check addressing for Table Calculations on each view. They should be:

for [Churn Status] --> Compute using [Month]

for both [# Customers (Filter)] and [# Customers (Size)] :

inner Calc ( [Churn Status] ) --> Compute using [Month]

outer Calc --> Compute using [Client ID]

Please find the attached wb with last two views modified.

Hope this could help.

Yours,

Yuri

2 of 2 people found this helpful
• ###### 2. Re: Another desperate plea for table calculation help - churn

Thanks Yuri,

Indeed your version fixes things up. I didn't even know that table calculations within table calculations could be addressed differently.

I must say your method for counting the size of the bucket, using ranks, is "weird" and hard to grasp. (I say that in ignorance , I'm not complaining!). I wonder if anybody has a simpler method for a simple person like me.

Cheers!

Geoff

• ###### 3. Re: Another desperate plea for table calculation help - churn

Hi Geoff,

Sizing (and numbering) buckets (which are Table Calcs in this case)

using RANK functions (because they are Table Calcs, too -- that's why)

is the most elegant (though not obvious) approach in Tableau,

thanks fellow Zen Masters Joe Mako and Jonathan Drummey.

For the thorough explanation, please refer to this blog article by Alexander Mou :

Vizible Difference: Histogram via Rank Functions

Yours,

Yuri

1 of 1 people found this helpful
• ###### 4. Re: Another desperate plea for table calculation help - churn

Thanks for additional resources. Indeed RANK seems more elegant than the brute force alternatives. Now if we could only sort the histogram colors in a consistent way it would be wonderful. At the moment the bar is sorted by customer id which is erratic.

• ###### 5. Re: Another desperate plea for table calculation help - churn

Hi Geoff,

Unfortunately, sorting a Dimension based on a Table Calculation is not possible.

One could sort Marks on a view using a Table Calc as a Discrete (Blue Pill),

but one should have this Pill on a view -- either on Rows or on Columns.

Yours,

Yuri

PS   That's why I built Cohort calculated fields as Dimensions using LOD calcs.

• ###### 6. Re: Another desperate plea for table calculation help - churn

Hi Geoff,

Thinking further about how stacked Marks could be sorted,

I came up with an un-elegant (aka brute-force) approach.

Call it "un-elegant" because Tableau is forced to behave

like any other ordinary "cursor-n-loop" programming language.

It's a corner case that doesn't fit nicely into a set-based paradigm of Tableau.

The main idea is to mimic Stacked bar Marks with Gantt ones.

The latter could be precisely positioned on a view using nested Table Calcs.