I attached a sample workbook for your reference.
I recommend you have a look at this article Top 15 Tableau LOD Expressions (Practical Examples)
There are helpful Cohort analysis samples in it.
Example.twbx 93.0 KB
Thanks for the reply, but I can't open the attached tableau workbook due to my tableau desktop version. Is there anyway you can save the sample workbook to or under version 10.0.10.
However, looking at the attached screenshot, the data doesn't look right. The column day0 should have all contained value '100%' as indicated below for day0 means the same day(0 day diff) if I understand right.
For the referenced article, Top 15 Tableau LOD Expressions (Practical Examples)
the scenario described in the article is slightly different from the one I have. In the article, the customers are group together by their first date of purchase so that date can be fixed by the LOD fixed expression. However, as opposed to it, I'm looking at the number of customers who ever made a purchase on ANY specific date, and the percentage of those customers made a purchase again in the next day and the day after and so on.
I attached a v10 workbook.
As for the calculation result for "0", some customers have more than one purchases on the first purchase day.
This depends on your business requirements.
There are two kinds of definitions of "first purchase".
1. The literally first purchase
If one than more purchases happened on the first purchase day, they are considered as the second purchase.
2. The purchase(s) happened on the first purchase day
If one than more purchases happened on the first purchase day, they are still considered as the first purchase.
Example_v10.twbx 91.2 KB