'What is the formula in SQL to calculate time/ number of days taken to sell x units of a product since its launch?

As part of a dashboard development, I need to know the number of days taken by a newly launched item to reach sales of 1000 units.

This is for benchmarking performance of the new product by comparing with the average days taken by other items in that category to reach 1000 units of sale. Hope this clarifies.

I will be using Big Query to solve this. Please help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source