Please see the attached workbook. Are you calculating days between transactions for a specific buyer, or just overall? You may need to use a level of detail calculation depending on the exact requirement.
But, since your data was for the same buyer I went ahead and put that data into Tableau. This will illustrate how you can accomplish this.
There are 2 calculations:
Previous date (this will allow you to use the DATEDIFF function to compare 2 dates): LOOKUP(ATTR([Date]),-1)
# Days between transactions: DATEDIFF('day',[Previous date],ATTR([Date]))
Book1.twbx 9.0 KB
Hi Stephan and Tina,
Check out the method in this post Average of days from last transaction for determining avg days between transactions, it would need to be modified to use a countd(date) as the denominator. Using lookup can work to get the average but it will require you to have the date field in your view. Using the method in the post provides a bit more flexibility on how you can use the average.