Hi there! I have a table like below:
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]Order Date[/TD]
[TD]Brand[/TD]
[TD]Product ID[/TD]
[TD]Customer ID[/TD]
[TD]Supermarket[/TD]
[TD]Sales Volume[/TD]
[TD]Sales Value ($)[/TD]
[/TR]
[TR]
[TD]01/09/2016[/TD]
[TD]Company A[/TD]
[TD]3431[/TD]
[TD]345452[/TD]
[TD]Supermarket B[/TD]
[TD]5[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]02/09/2016[/TD]
[TD]Company A[/TD]
[TD]3524[/TD]
[TD]243784[/TD]
[TD]Supermarket B[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]02/09/2016[/TD]
[TD]Company B[/TD]
[TD]3122[/TD]
[TD]345452[/TD]
[TD]Supermarket A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
I'd like to answer:
Average number of days between orders of a customer
How do I first group orders by each unique customer, find the days between their orders, then find the average?
Thanks for the help guys and gals!
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]Order Date[/TD]
[TD]Brand[/TD]
[TD]Product ID[/TD]
[TD]Customer ID[/TD]
[TD]Supermarket[/TD]
[TD]Sales Volume[/TD]
[TD]Sales Value ($)[/TD]
[/TR]
[TR]
[TD]01/09/2016[/TD]
[TD]Company A[/TD]
[TD]3431[/TD]
[TD]345452[/TD]
[TD]Supermarket B[/TD]
[TD]5[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]02/09/2016[/TD]
[TD]Company A[/TD]
[TD]3524[/TD]
[TD]243784[/TD]
[TD]Supermarket B[/TD]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]02/09/2016[/TD]
[TD]Company B[/TD]
[TD]3122[/TD]
[TD]345452[/TD]
[TD]Supermarket A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
</tbody>[/TABLE]
I'd like to answer:
Average number of days between orders of a customer
How do I first group orders by each unique customer, find the days between their orders, then find the average?
Thanks for the help guys and gals!